/** * Decode the base 64 encoded string writing it to the given output stream. Whitespace characters * will be ignored. * * @param data Base 64 encoded data. * @param out Stream to write the data to. * @return The number of bytes produced. * @throws java.io.IOException */ public static int decodeData(String data, OutputStream out) throws IOException { return encoder.decode(data, out); }
/** * Encode the input data to base 64 writing it to the given output stream. * * @param data Data to be encoded as base 64. * @param out Stream to write the data to. * @return The number of bytes produced. * @throws java.io.IOException Thrown when writing to the stream failed. */ public static int encodeData(byte[] data, OutputStream out) throws IOException { int inLength = data.length; return encoder.encode(data, 0, inLength, out); }
/** * Decode the base 64 encoded data writing it to the given output stream. Whitespace characters * will be ignored. * * @param data Base 64 encoded data. * @param out Stream to write the data to. * @return The number of bytes produced. * @throws java.io.IOException */ public static int decodeData(byte[] data, OutputStream out) throws IOException { return encoder.decode(data, 0, data.length, out); }