Inheritance diagram for org.apache.commons.codec.binary.Base64:
This class implements section <cite>6.8. Base64 Content-Transfer-Encoding</cite> from RFC 2045 <cite>Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</cite> by Freed and Borenstein.
Definition at line 36 of file Base64.java.
Public Member Functions | |
Object | decode (Object pObject) throws DecoderException |
Decodes an Object using the base64 algorithm. | |
byte[] | decode (byte[] pArray) |
Decodes a byte[] containing containing characters in the Base64 alphabet. | |
Object | encode (Object pObject) throws EncoderException |
Encodes an Object using the base64 algorithm. | |
byte[] | encode (byte[] pArray) |
Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64 alphabet. | |
Static Public Member Functions | |
static boolean | isArrayByteBase64 (byte[] arrayOctect) |
Tests a given byte array to see if it contains only valid characters within the Base64 alphabet. | |
static byte[] | encodeBase64 (byte[] binaryData) |
Encodes binary data using the base64 algorithm but does not chunk the output. | |
static byte[] | encodeBase64Chunked (byte[] binaryData) |
Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks. | |
static byte[] | encodeBase64 (byte[] binaryData, boolean isChunked) |
Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks. | |
static byte[] | decodeBase64 (byte[] base64Data) |
Decodes Base64 data into octects. | |
Static Package Functions | |
static byte[] | discardWhitespace (byte[] data) |
Discards any whitespace from a base-64 encoded block. | |
static byte[] | discardNonBase64 (byte[] data) |
Discards any characters outside of the base64 alphabet, per the requirements on page 25 of RFC 2045 - "Any characters outside of the base64 alphabet are to be ignored in base64 encoded data. | |
Static Package Attributes | |
static final int | CHUNK_SIZE = 76 |
Chunk size per RFC 2045 section 6.8. | |
static final byte[] | CHUNK_SEPARATOR = "\r\n".getBytes() |
Chunk separator per RFC 2045 section 2.1. | |
static final int | BASELENGTH = 255 |
The base length. | |
static final int | LOOKUPLENGTH = 64 |
Lookup length. | |
static final int | EIGHTBIT = 8 |
Used to calculate the number of bits in a byte. | |
static final int | SIXTEENBIT = 16 |
Used when encoding something which has fewer than 24 bits. | |
static final int | TWENTYFOURBITGROUP = 24 |
Used to determine how many bits data contains. | |
static final int | FOURBYTE = 4 |
Used to get the number of Quadruples. | |
static final int | SIGN = -128 |
Used to test the sign of a byte. | |
static final byte | PAD = (byte) '=' |
Byte used to pad output. |
|
Decodes a byte[] containing containing characters in the Base64 alphabet.
Implements org.apache.commons.codec.BinaryDecoder. Definition at line 219 of file Base64.java. References org.apache.commons.codec.binary.Base64.decodeBase64(). |
|
Decodes an Object using the base64 algorithm. This method is provided in order to satisfy the requirements of the Decoder interface, and will throw a DecoderException if the supplied object is not of type byte[].
Implements org.apache.commons.codec.Decoder. Definition at line 205 of file Base64.java. |
|
Decodes Base64 data into octects.
Definition at line 372 of file Base64.java. References org.apache.commons.codec.binary.Base64.discardNonBase64(), org.apache.commons.codec.binary.Base64.FOURBYTE, and org.apache.commons.codec.binary.Base64.PAD. Referenced by org.apache.commons.codec.binary.Base64.decode(). |
|
Discards any characters outside of the base64 alphabet, per the requirements on page 25 of RFC 2045 - "Any characters outside of the base64 alphabet are to be ignored in base64 encoded data. "
Definition at line 473 of file Base64.java. Referenced by org.apache.commons.codec.binary.Base64.decodeBase64(). |
|
Discards any whitespace from a base-64 encoded block.
Definition at line 441 of file Base64.java. Referenced by org.apache.commons.codec.binary.Base64.isArrayByteBase64(). |
|
Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64 alphabet.
Implements org.apache.commons.codec.BinaryEncoder. Definition at line 520 of file Base64.java. References org.apache.commons.codec.binary.Base64.encodeBase64(). |
|
Encodes an Object using the base64 algorithm. This method is provided in order to satisfy the requirements of the Encoder interface, and will throw an EncoderException if the supplied object is not of type byte[].
Implements org.apache.commons.codec.Encoder. Definition at line 505 of file Base64.java. |
|
Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
Definition at line 232 of file Base64.java. References org.apache.commons.codec.binary.Base64.CHUNK_SEPARATOR, org.apache.commons.codec.binary.Base64.CHUNK_SIZE, org.apache.commons.codec.binary.Base64.EIGHTBIT, org.apache.commons.codec.binary.Base64.PAD, org.apache.commons.codec.binary.Base64.SIGN, org.apache.commons.codec.binary.Base64.SIXTEENBIT, and org.apache.commons.codec.binary.Base64.TWENTYFOURBITGROUP. |
|
Encodes binary data using the base64 algorithm but does not chunk the output.
Definition at line 177 of file Base64.java. Referenced by org.apache.commons.codec.binary.Base64.encode(), and org.apache.commons.codec.binary.Base64.encodeBase64Chunked(). |
|
Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks.
Definition at line 188 of file Base64.java. References org.apache.commons.codec.binary.Base64.encodeBase64(). |
|
Tests a given byte array to see if it contains only valid characters within the Base64 alphabet.
Definition at line 152 of file Base64.java. References org.apache.commons.codec.binary.Base64.discardWhitespace(). |
|
Chunk separator per RFC 2045 section 2.1.
Definition at line 53 of file Base64.java. Referenced by org.apache.commons.codec.binary.Base64.encodeBase64(). |
|
Chunk size per RFC 2045 section 6.8. The {} character limit does not count the trailing CRLF, but counts all other characters, including any equal signs.
Definition at line 46 of file Base64.java. Referenced by org.apache.commons.codec.binary.Base64.encodeBase64(). |