Class Base64Util

java.lang.Object
net.sf.jasperreports.util.Base64Util

public class Base64Util extends 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)
  • Field Details

    • DEFAULT_LINE_LENGTH

      public static final Integer DEFAULT_LINE_LENGTH
    • DEFAULT_LINE_SEPARATOR

      public static final byte[] DEFAULT_LINE_SEPARATOR
  • Constructor Details

    • Base64Util

      public Base64Util()
  • Method Details

    • decode

      public static void decode(InputStream in, OutputStream out) throws 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:
      IOException
    • decode

      public static byte[] decode(String data) throws IOException
      Throws:
      IOException
    • encode

      public static void encode(InputStream in, OutputStream out) throws 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:
      IOException
    • encode

      public static void encode(InputStream in, OutputStream out, boolean multiLineOutput) throws 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:
      IOException
    • encode

      public static String encode(byte[] data, boolean multiLineOutput)
    • encode

      public static String encode(byte[] data)