decode
Decodes a BASE64 encoded char array. All illegal characters will be ignored and can handle both arrays with and without line separators.
Return
The decoded array of bytes. May be of length 0. Will be null
if the legal characters (including '=') isn't divideable by 4. (I.e. definitely corrupted).
Parameters
The source array. null
or length 0 will return an empty array.
Decodes a BASE64 encoded byte array. All illegal characters will be ignored and can handle both arrays with and without line separators.
Return
The decoded array of bytes. May be of length 0. Will be null
if the legal characters (including '=') isn't divideable by 4. (I.e. definitely corrupted).
Parameters
The source array. Length 0 will return an empty array. null
will throw an exception.
Decodes a BASE64 encoded byte array. All illegal characters will be ignored and can handle both arrays with and without line separators.
Return
The decoded array of bytes. May be of length 0. Will be null
if the legal characters (including '=') isn't divideable by 4. (I.e. definitely corrupted).
Parameters
The source array. null
will throw an exception.
The starting position in the source array.
The number of bytes to decode from the source array. Length 0 will return an empty array.
Decodes a BASE64 encoded String
. All illegal characters will be ignored and can handle both strings with and without line separators.Note! It can be up to about 2x the speed to call decode(str.toCharArray())
instead. That will create a temporary array though. This version will use str.charAt(i)
to iterate the string.
Return
The decoded array of bytes. May be of length 0. Will be null
if the legal characters (including '=') isn't divideable by 4. (I.e. definitely corrupted).
Parameters
The source string. null
or length 0 will return an empty array.