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. |
static boolean org.apache.commons.codec.binary.Base64.isArrayByteBase64 | ( | byte[] | arrayOctect | ) | [static] |
Tests a given byte array to see if it contains only valid characters within the Base64 alphabet.
arrayOctect | byte array to test |
Definition at line 152 of file Base64.java.
References org.apache.commons.codec.binary.Base64.discardWhitespace().
static byte [] org.apache.commons.codec.binary.Base64.encodeBase64 | ( | byte[] | binaryData | ) | [static] |
Encodes binary data using the base64 algorithm but does not chunk the output.
binaryData | binary data to encode |
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().
static byte [] org.apache.commons.codec.binary.Base64.encodeBase64Chunked | ( | byte[] | binaryData | ) | [static] |
Encodes binary data using the base64 algorithm and chunks the encoded output into 76 character blocks.
binaryData | binary data to encode |
Definition at line 188 of file Base64.java.
References org.apache.commons.codec.binary.Base64.encodeBase64().
Object org.apache.commons.codec.binary.Base64.decode | ( | Object | pObject | ) | throws DecoderException |
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[].
pObject | Object to decode |
DecoderException | if the parameter supplied is not of type byte[] |
Implements org.apache.commons.codec.Decoder.
Definition at line 205 of file Base64.java.
byte [] org.apache.commons.codec.binary.Base64.decode | ( | byte[] | pArray | ) |
Decodes a byte[] containing containing characters in the Base64 alphabet.
pArray | A byte array containing Base64 character data |
Implements org.apache.commons.codec.BinaryDecoder.
Definition at line 219 of file Base64.java.
References org.apache.commons.codec.binary.Base64.decodeBase64().
static byte [] org.apache.commons.codec.binary.Base64.encodeBase64 | ( | byte[] | binaryData, | |
boolean | isChunked | |||
) | [static] |
Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
binaryData | Array containing binary data to encode. | |
isChunked | if isChunked is true this encoder will chunk the base64 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.
static byte [] org.apache.commons.codec.binary.Base64.decodeBase64 | ( | byte[] | base64Data | ) | [static] |
Decodes Base64 data into octects.
base64Data | Byte array containing Base64 data |
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().
static byte [] org.apache.commons.codec.binary.Base64.discardWhitespace | ( | byte[] | data | ) | [static, package] |
Discards any whitespace from a base-64 encoded block.
data | The base-64 encoded data to discard the whitespace from. |
Definition at line 441 of file Base64.java.
Referenced by org.apache.commons.codec.binary.Base64.isArrayByteBase64().
static byte [] org.apache.commons.codec.binary.Base64.discardNonBase64 | ( | byte[] | data | ) | [static, package] |
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.
"
data | The base-64 encoded data to groom |
Definition at line 473 of file Base64.java.
Referenced by org.apache.commons.codec.binary.Base64.decodeBase64().
Object org.apache.commons.codec.binary.Base64.encode | ( | Object | pObject | ) | throws EncoderException |
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[].
pObject | Object to encode |
EncoderException | if the parameter supplied is not of type byte[] |
Implements org.apache.commons.codec.Encoder.
Definition at line 505 of file Base64.java.
byte [] org.apache.commons.codec.binary.Base64.encode | ( | byte[] | pArray | ) |
Encodes a byte[] containing binary data, into a byte[] containing characters in the Base64 alphabet.
pArray | a byte array containing binary data |
Implements org.apache.commons.codec.BinaryEncoder.
Definition at line 520 of file Base64.java.
References org.apache.commons.codec.binary.Base64.encodeBase64().
final int org.apache.commons.codec.binary.Base64.CHUNK_SIZE = 76 [static, package] |
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().
final byte [] org.apache.commons.codec.binary.Base64.CHUNK_SEPARATOR = "\r\n".getBytes() [static, package] |
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().