/** * Decode a requested number of bytes of data into a buffer. * * @return true if we were able to obtain more data, false otherwise. */ private boolean decodeStreamData() throws IOException { decodedIndex = 0; // fill up a data buffer with input data int readCharacters = fillEncodedBuffer(); if (readCharacters > 0) { try { decodedChars = Base64Utility.decodeChunk(encodedChars, 0, readCharacters); } catch (Base64Exception e) { throw new IOException(e); } decodedCount = decodedChars.length; return true; } return false; }
/** * Decode a requested number of bytes of data into a buffer. * * @return true if we were able to obtain more data, false otherwise. */ private boolean decodeStreamData() throws IOException { decodedIndex = 0; // fill up a data buffer with input data int readCharacters = fillEncodedBuffer(); if (readCharacters > 0) { try { decodedChars = Base64Utility.decodeChunk(encodedChars, 0, readCharacters); } catch (Base64Exception e) { throw new IOException(e); } decodedCount = decodedChars.length; return true; } return false; }
public static void decode(char[] id, int o, int l, OutputStream ostream) throws Base64Exception { try { ostream.write(decodeChunk(id, o, l)); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + new String(id)); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(char[] id, int o, int l, OutputStream ostream) throws Base64Exception { try { ostream.write(decodeChunk(id, o, l)); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + new String(id)); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(char[] id, int o, int l, OutputStream ostream) throws Base64Exception { try { ostream.write(decodeChunk(id, o, l)); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + new String(id)); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(char[] id, int o, int l, OutputStream ostream) throws Base64Exception { try { ostream.write(decodeChunk(id, o, l)); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + new String(id)); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(char[] id, int o, int l, OutputStream ostream) throws Base64Exception { try { ostream.write(decodeChunk(id, o, l)); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + new String(id)); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static byte[] decode(String id) throws Base64Exception { try { char[] cd = id.toCharArray(); return decodeChunk(cd, 0, cd.length); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static byte[] decode(String id) throws Base64Exception { try { char[] cd = id.toCharArray(); return decodeChunk(cd, 0, cd.length); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static byte[] decode(String id) throws Base64Exception { try { char[] cd = id.toCharArray(); return decodeChunk(cd, 0, cd.length); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(String id, OutputStream ostream) throws Base64Exception { try { char[] cd = id.toCharArray(); ostream.write(decodeChunk(cd, 0, cd.length)); } catch (IOException ioe) { throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(String id, OutputStream ostream) throws Base64Exception { try { char[] cd = id.toCharArray(); ostream.write(decodeChunk(cd, 0, cd.length)); } catch (IOException ioe) { throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(String id, OutputStream ostream) throws Base64Exception { try { char[] cd = id.toCharArray(); ostream.write(decodeChunk(cd, 0, cd.length)); } catch (IOException ioe) { throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(String id, OutputStream ostream) throws Base64Exception { try { char[] cd = id.toCharArray(); ostream.write(decodeChunk(cd, 0, cd.length)); } catch (IOException ioe) { throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static void decode(String id, OutputStream ostream) throws Base64Exception { try { char[] cd = id.toCharArray(); ostream.write(decodeChunk(cd, 0, cd.length)); } catch (IOException ioe) { throw new Base64Exception(new Message("BASE64_DECODE_IOEXCEPTION", LOG), ioe); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static byte[] decode(String id, boolean urlSafe) throws Base64Exception { if (urlSafe) { id = id.replace('-', '+').replace('_', '/'); switch (id.length() % 4) { case 0: break; case 2: id += "=="; break; case 3: id += "="; break; default: throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG)); } } try { char[] cd = id.toCharArray(); return decodeChunk(cd, 0, cd.length); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }
public static byte[] decode(String id, boolean urlSafe) throws Base64Exception { if (urlSafe) { id = id.replace('-', '+').replace('_', '/'); switch (id.length() % 4) { case 0: break; case 2: id += "=="; break; case 3: id += "="; break; default: throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG)); } } try { char[] cd = id.toCharArray(); return decodeChunk(cd, 0, cd.length); } catch (Exception e) { LOG.warning("Invalid base64 encoded string : " + id); throw new Base64Exception(new Message("BASE64_RUNTIME_EXCEPTION", LOG), e); } }