The class can be parameterized in the following manner with various constructors:

URL-safe mode: Default off.

Line length: Default 76. Line length that aren't multiples of 4 will still essentially end up being multiples of
4 in the encoded data.

Line separator: Default is CRLF ("\r\n")

The URL-safe parameter is only applied to encode operations. Decoding seamlessly handles both modes.

Since this class operates directly on byte streams, and not character streams, it is hard-coded to only
encode/decode character encodings which are compatible with the lower 127 ASCII chart (ISO-8859-1, Windows-1252,
UTF-8, etc).

Base64

Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.

When encoding the line length is given in the constructor, the line separator is CRLF, and the encoding table is
STANDARD_ENCODE_TABLE.

Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.

When decoding all variants are supported.

Parameters:

lineLength - Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
decoding.

Base64

Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.

When encoding the line length and line separator are given in the constructor, and the encoding table is
STANDARD_ENCODE_TABLE.

Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.

When decoding all variants are supported.

Parameters:

lineLength - Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
decoding.

lineSeparator - Each line of encoded data will end with this sequence of bytes.

Base64

Creates a Base64 codec used for decoding (all modes) and encoding in URL-unsafe mode.

When encoding the line length and line separator are given in the constructor, and the encoding table is
STANDARD_ENCODE_TABLE.

Line lengths that aren't multiples of 4 will still essentially end up being multiples of 4 in the encoded data.

When decoding all variants are supported.

Parameters:

lineLength - Each line of encoded data will be at most of the given length (rounded down to nearest multiple of
4). If lineLength <= 0, then the output will not be divided into lines (chunks). Ignored when
decoding.

lineSeparator - Each line of encoded data will end with this sequence of bytes.

urlSafe - Instead of emitting '+' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode
operations. Decoding seamlessly handles both modes.
Note: no padding is added when using the URL-safe alphabet.

encodeBase64String

Encodes binary data using the base64 algorithm but does not chunk the output.
NOTE: We changed the behaviour of this method from multi-line chunking (commons-codec-1.4) to
single-line non-chunking (commons-codec-1.5).