final class Base64Decoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static byte[] |
DECODING_TABLE
Set up the decoding table; this is indexed by a byte converted to an unsigned int,
so must be at least as large as the number of different byte values,
positive and negative and zero.
|
private static byte[] |
ENCODING_TABLE
Set up the encoding table.
|
private static int |
INPUT_BYTES_PER_CHUNK
Number of bytes per encoded chunk - 4 6bit bytes produce 3 8bit bytes on output.
|
private static int |
INVALID_BYTE
Decoding table value for invalid bytes.
|
private static int |
MASK_BYTE_UNSIGNED
Mask to treat byte as unsigned integer.
|
private static int |
PAD_BYTE
Decoding table value for padding bytes, so can detect PAD afer conversion.
|
private static byte |
PADDING
The padding byte.
|
Modifier | Constructor and Description |
---|---|
private |
Base64Decoder()
Hidden constructor, this class must not be instantiated.
|
Modifier and Type | Method and Description |
---|---|
static int |
decode(byte[] data,
java.io.OutputStream out)
Decode the base 64 encoded byte data writing it to the given output stream,
whitespace characters will be ignored.
|
private static final int INVALID_BYTE
private static final int PAD_BYTE
private static final int MASK_BYTE_UNSIGNED
private static final int INPUT_BYTES_PER_CHUNK
private static final byte[] ENCODING_TABLE
private static final byte PADDING
private static final byte[] DECODING_TABLE
private Base64Decoder()
public static int decode(byte[] data, java.io.OutputStream out) throws java.io.IOException
data
- the buffer containing the Base64-encoded dataout
- the output stream to hold the decoded bytesjava.io.IOException
- thrown when the padding is incorrect or the input is truncated.