Only the features currently used by HttpClient are implemented here rather than all the features of Commons Codec.
Notes:
| Modifier and Type | Field and Description |
|---|---|
| private static final Base64 | |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| public | Base64()
Return an instance of the Base64 codec that use the regular Base64 alphabet (as opposed to the URL-safe alphabet). |
| public | Base64(final int lineLength)
Creates a Base64 codec used for decoding and encoding in URL-unsafe mode. |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | decode(final byte[] base64)
Decode Base64-encoded bytes to their original form, using specifications from this codec instance |
| public byte[] | |
| public static byte[] | |
| public static byte[] | |
| public byte[] | encode(final byte[] value)
Encode bytes to their Base64 form, using specifications from this codec instance |
| public static byte[] | encodeBase64(final byte[] base64)
Encodes binary data using the base64 algorithm but does not chunk the output. |
| public static String | encodeBase64String(final byte[] bytes)
Encodes binary data using the base64 algorithm but does not chunk the output. |
| CODEC | back to summary |
|---|---|
| private static final Base64 CODEC | |
| EMPTY_BYTES | back to summary |
|---|---|
| private static final byte[] EMPTY_BYTES | |
| Base64 | back to summary |
|---|---|
| public Base64() Return an instance of the Base64 codec that use the regular Base64 alphabet (as opposed to the URL-safe alphabet). Note that unlike the Commons Codec version, thus class will NOT decode characters from URL-safe alphabet. | |
| Base64 | back to summary |
|---|---|
| public Base64(final int lineLength) Creates a Base64 codec used for decoding and encoding in URL-unsafe mode. As HttpClient never uses a non-zero length, this feature is not implemented here. | |
| decode | back to summary |
|---|---|
| public byte[] decode(final byte[] base64) Decode Base64-encoded bytes to their original form, using specifications from this codec instance | |
| decode | back to summary |
|---|---|
| public byte[] decode(final String base64) Decode a Base64 String to its original form, using specifications from this codec instance | |
| decodeBase64 | back to summary |
|---|---|
| public static byte[] decodeBase64(final byte[] base64) Decodes Base64 data into octets. Note this method does NOT accept URL-safe encodings | |
| decodeBase64 | back to summary |
|---|---|
| public static byte[] decodeBase64(final String base64) Decodes a Base64 String into octets. Note this method does NOT accept URL-safe encodings | |
| encode | back to summary |
|---|---|
| public byte[] encode(final byte[] value) Encode bytes to their Base64 form, using specifications from this codec instance | |
| encodeBase64 | back to summary |
|---|---|
| public static byte[] encodeBase64(final byte[] base64) Encodes binary data using the base64 algorithm but does not chunk the output. | |
| encodeBase64String | back to summary |
|---|---|
| public static String encodeBase64String(final byte[] bytes) Encodes binary data using the base64 algorithm but does not chunk the output. | |