Class Base64


  • public final class Base64
    extends Object
    Provides utility methods to Base64 encode data. This class uses the Base64 encoding as specified in RFC 2045, 6.8. Base64 Content-Transfer-Encoding. All strings are considered UTF-8.
    • Method Detail

      • encode

        public static String encode​(String string)
        Base64 encodes the specified string using the platform's default encoding.
        Parameters:
        string - the string to encode
        Returns:
        the encoded string
      • encode

        public static String encode​(byte[] bytes)
        Base64 encodes the specified bytes to a String.
        Parameters:
        bytes - the bytes to encode
        Returns:
        the encoded bytes as a string