Beispiel #1
0
 /**
  * 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);
 }
Beispiel #2
0
 /**
  * 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);
 }
Beispiel #3
0
 /**
  * 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);
 }