Class Base64

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static char[] ALPHABET
      code characters for values 0..63
      private static byte[] CODES
      lookup table for converting base64 characters to value in range 0..63
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Base64()
      Private constructor.
    • Field Detail

      • ALPHABET

        private static final char[] ALPHABET
        code characters for values 0..63
      • CODES

        private static final byte[] CODES
        lookup table for converting base64 characters to value in range 0..63
    • Constructor Detail

      • Base64

        private Base64()
        Private constructor.
    • Method Detail

      • encode

        public static char[] encode​(byte[] data)
        Deprecated.
        Use the java.util.Base64.getEncoder().encode(byte[]) method instead
        Encodes binary data to a Base64 encoded characters.
        Parameters:
        data - the array of bytes to encode
        Returns:
        base64-coded character array.
      • decode

        public static byte[] decode​(char[] data)
        Deprecated.
        Use the java.util.Base64.geDecoder().decode(String) method instead
        Decodes a BASE-64 encoded stream to recover the original data. White space before and after will be trimmed away, but no other manipulation of the input will be performed. As of version 1.2 this method will properly handle input containing junk characters (newlines and the like) rather than throwing an error. It does this by pre-parsing the input and generating from that a count of VALID input characters.
        Parameters:
        data - data to decode.
        Returns:
        the decoded binary data.