DefaultBase64
Base64
This class consists exclusively of static methods for obtaining encoders and decoders for the Base64 encoding scheme. This implementation supports Base64 encodings as specified in RFC 4648 and RFC 2045.
Basic Encoding
Uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for encoding and decoding operation. The encoder does not add any line feed (line separator) character. The decoder rejects data that contains characters outside the base64 alphabet.
URL-safe Encoding
Uses the "URL and Filename safe Base64 Alphabet" as specified in Table 2 of RFC 4648 for encoding and decoding. The encoder does not add any line feed (line separator) character. The decoder rejects data that contains characters outside the base64 alphabet.
MIME
Uses "The Base64 Alphabet" as specified in Table 1 of RFC 2045 for encoding and decoding operation. The encoded output must be represented in lines of no more than 76 characters each and uses a carriage return '\r'
followed immediately by a linefeed '\n'
as the line separator. No line separator is added to the end of the encoded output.
All line separators or other characters not found in the base64 alphabet table are ignored in the decoding operation.
Unless otherwise noted, passing a null
argument to a method of this class will cause a NullPointerException
to be thrown.
Author
Xueming Shen
Sam Gammon
Functions
Encode the provided data into a Base64-encoded set of bytes, omitting characters which are unsafe for use on the web, including padding characters, which are not emitted.
Encode the provided string into a Base64-encoded string, omitting characters which are unsafe for use on the web, including padding characters, which are not emitted.