Class Base64


  • public final class Base64
    extends Object
    This class provides methods for performing base64 encoding and decoding. Base64 is a mechanism for encoding binary data in ASCII form by converting sets of three bytes with eight significant bits each to sets of four bytes with six significant bits each.
    • Method Detail

      • encode

        public static String encode​(byte[] bytes)
        Encodes the provided data as a base64 string.
        Parameters:
        bytes - The data to be encoded.
        Returns:
        The base64 encoded representation of bytes.
        Throws:
        NullPointerException - If bytes was null.
      • encode

        public static String encode​(ByteSequence bytes)
        Encodes the provided data as a base64 string.
        Parameters:
        bytes - The data to be encoded.
        Returns:
        The base64 encoded representation of bytes.
        Throws:
        NullPointerException - If bytes was null.