Class Base64Util


  • public class Base64Util
    extends java.lang.Object
    Utility class to decode Base64 encoded input stream to output stream or to Base64 encode input stream to output stream
    Author:
    Sanda Zaharia (shertage@users.sourceforge.net)
    • Constructor Summary

      Constructors 
      Constructor Description
      Base64Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void decode​(java.io.InputStream in, java.io.OutputStream out)
      Decode an input stream and write processed data to an output stream
      static byte[] decode​(java.lang.String data)  
      static java.lang.String encode​(byte[] data)  
      static java.lang.String encode​(byte[] data, boolean multiLineOutput)  
      static void encode​(java.io.InputStream in, java.io.OutputStream out)
      Encode an input stream and write processed data to an output stream
      static void encode​(java.io.InputStream in, java.io.OutputStream out, boolean multiLineOutput)
      Encode an input stream and write processed data to an output stream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_LINE_LENGTH

        public static final java.lang.Integer DEFAULT_LINE_LENGTH
      • DEFAULT_LINE_SEPARATOR

        public static final byte[] DEFAULT_LINE_SEPARATOR
    • Constructor Detail

      • Base64Util

        public Base64Util()
    • Method Detail

      • decode

        public static void decode​(java.io.InputStream in,
                                  java.io.OutputStream out)
                           throws java.io.IOException
        Decode an input stream and write processed data to an output stream
        Parameters:
        in - the input stream to be decoded
        out - the output stream to write the decoded data
        Throws:
        java.io.IOException
      • decode

        public static byte[] decode​(java.lang.String data)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • encode

        public static void encode​(java.io.InputStream in,
                                  java.io.OutputStream out)
                           throws java.io.IOException
        Encode an input stream and write processed data to an output stream
        Parameters:
        in - the input stream to be encoded
        out - the output stream to write the encoded data
        Throws:
        java.io.IOException
      • encode

        public static void encode​(java.io.InputStream in,
                                  java.io.OutputStream out,
                                  boolean multiLineOutput)
                           throws java.io.IOException
        Encode an input stream and write processed data to an output stream
        Parameters:
        in - the input stream to be encoded
        out - the output stream to write the encoded data
        multiLineOutput - specifies whether the output should be formatted into multiple rows using a line separator
        Throws:
        java.io.IOException
      • encode

        public static java.lang.String encode​(byte[] data,
                                              boolean multiLineOutput)
      • encode

        public static java.lang.String encode​(byte[] data)