Implementation Notes
| Modifier and Type | Field and Description |
|---|---|
| private final int[] | _asciiToBase64
Decoding table used for base 64 decoding. |
| private final byte[] | _base64ToAsciiB
Alternative encoding table used for base 64 decoding when output is done as ascii bytes. |
| private final char[] | _base64ToAsciiC
Encoding table used for base 64 decoding when output is done as characters. |
| pack-priv final int | _maxLineLength
Maximum number of encoded base64 characters to output during encoding
before adding a linefeed, if line length is to be limited
( |
| pack-priv final String | _name
Symbolic name of variant; used for diagnostics/debugging. |
| pack-priv final char | _paddingChar
Characted used for padding, if any ( |
| pack-priv final boolean | _usesPadding
Whether this variant uses padding or not. |
| public static final int | BASE64_VALUE_INVALID
Marker used to denote ascii characters that do not correspond to a 6-bit value (in this variant), and is not used as a padding character. |
| public static final int | BASE64_VALUE_PADDING
Marker used to denote ascii character (in decoding table) that is the padding character using this variant (if any). |
| pack-priv static final char | PADDING_CHAR_NONE
Placeholder used by "no padding" variant, to be used when a character value is needed. |
| Access | Constructor and Description |
|---|---|
| public | Base64Variant(String name, String base64Alphabet, boolean usesPadding, char paddingChar, int maxLineLength)
|
| public | Base64Variant(Base64Variant base, String name, int maxLineLength)
"Copy constructor" that can be used when the base alphabet is identical to one used by another variant except for the maximum line length (and obviously, name). |
| public | Base64Variant(Base64Variant base, String name, boolean usesPadding, char paddingChar, int maxLineLength)
"Copy constructor" that can be used when the base alphabet is identical to one used by another variant, but other details (padding, maximum line length) differ |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | |
| public byte | |
| public char | |
| public int | encodeBase64Chunk(int b24, char[] buffer, int ptr)
Method that encodes given right-aligned (LSB) 24-bit value into 4 base64 characters, stored in given result buffer. |
| public int | encodeBase64Chunk(int b24, byte[] buffer, int ptr)
Method that encodes given right-aligned (LSB) 24-bit value into 4 base64 bytes (ascii), stored in given result buffer. |
| public int | encodeBase64Partial(int bits, int
Number of encoded bytes included (either 1 or 2) outputBytes, char[] buffer, int outPtr)Method that outputs partial chunk (which only encodes one or two bytes of data). |
| public int | encodeBase64Partial(int bits, int
Number of encoded bytes included (either 1 or 2) outputBytes, byte[] buffer, int outPtr)Method that outputs partial chunk (which only encodes one or two bytes of data). |
| public int | |
| public String | |
| public byte | |
| public char | |
| public String | |
| public boolean | |
| public boolean |
| _asciiToBase64 | back to summary |
|---|---|
| private final int[] _asciiToBase64 Decoding table used for base 64 decoding. | |
| _base64ToAsciiB | back to summary |
|---|---|
| private final byte[] _base64ToAsciiB Alternative encoding table used for base 64 decoding when output is done as ascii bytes. | |
| _base64ToAsciiC | back to summary |
|---|---|
| private final char[] _base64ToAsciiC Encoding table used for base 64 decoding when output is done as characters. | |
| _maxLineLength | back to summary |
|---|---|
| pack-priv final int _maxLineLength Maximum number of encoded base64 characters to output during encoding
before adding a linefeed, if line length is to be limited
( Note for some output modes (when writing attributes) linefeeds may need to be avoided, and this value ignored. | |
| _name | back to summary |
|---|---|
| pack-priv final String _name Symbolic name of variant; used for diagnostics/debugging. | |
| _paddingChar | back to summary |
|---|---|
| pack-priv final char _paddingChar Characted used for padding, if any ( | |
| _usesPadding | back to summary |
|---|---|
| pack-priv final boolean _usesPadding Whether this variant uses padding or not. | |
| BASE64_VALUE_INVALID | back to summary |
|---|---|
| public static final int BASE64_VALUE_INVALID Marker used to denote ascii characters that do not correspond to a 6-bit value (in this variant), and is not used as a padding character. | |
| BASE64_VALUE_PADDING | back to summary |
|---|---|
| public static final int BASE64_VALUE_PADDING Marker used to denote ascii character (in decoding table) that is the padding character using this variant (if any). | |
| PADDING_CHAR_NONE | back to summary |
|---|---|
| pack-priv static final char PADDING_CHAR_NONE Placeholder used by "no padding" variant, to be used when a character value is needed. | |
| Base64Variant | back to summary |
|---|---|
| public Base64Variant(String name, String base64Alphabet, boolean usesPadding, char paddingChar, int maxLineLength) | |
| Base64Variant | back to summary |
|---|---|
| public Base64Variant(Base64Variant base, String name, int maxLineLength) "Copy constructor" that can be used when the base alphabet is identical to one used by another variant except for the maximum line length (and obviously, name). | |
| Base64Variant | back to summary |
|---|---|
| public Base64Variant(Base64Variant base, String name, boolean usesPadding, char paddingChar, int maxLineLength) "Copy constructor" that can be used when the base alphabet is identical to one used by another variant, but other details (padding, maximum line length) differ | |
| decodeBase64Byte | back to summary |
|---|---|
| public int decodeBase64Byte(byte b) | |
| decodeBase64Char | back to summary |
|---|---|
public int decodeBase64Char(char c)
| |
| encodeBase64BitsAsByte | back to summary |
|---|---|
| public byte encodeBase64BitsAsByte(int value) | |
| encodeBase64BitsAsChar | back to summary |
|---|---|
| public char encodeBase64BitsAsChar(int value) | |
| encodeBase64Chunk | back to summary |
|---|---|
| public int encodeBase64Chunk(int b24, char[] buffer, int ptr) Method that encodes given right-aligned (LSB) 24-bit value into 4 base64 characters, stored in given result buffer. | |
| encodeBase64Chunk | back to summary |
|---|---|
| public int encodeBase64Chunk(int b24, byte[] buffer, int ptr) Method that encodes given right-aligned (LSB) 24-bit value into 4 base64 bytes (ascii), stored in given result buffer. | |
| encodeBase64Partial | back to summary |
|---|---|
| public int encodeBase64Partial(int bits, int outputBytes, char[] buffer, int outPtr) Method that outputs partial chunk (which only encodes one or two bytes of data). Data given is still aligned same as if it as full data; that is, missing data is at the "right end" (LSB) of int.
| |
| encodeBase64Partial | back to summary |
|---|---|
| public int encodeBase64Partial(int bits, int outputBytes, byte[] buffer, int outPtr) Method that outputs partial chunk (which only encodes one or two bytes of data). Data given is still aligned same as if it as full data; that is, missing data is at the "right end" (LSB) of int.
| |
| getMaxLineLength | back to summary |
|---|---|
| public int getMaxLineLength() | |
| getName | back to summary |
|---|---|
| public String getName() | |
| getPaddingByte | back to summary |
|---|---|
| public byte getPaddingByte() | |
| getPaddingChar | back to summary |
|---|---|
| public char getPaddingChar() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| usesPadding | back to summary |
|---|---|
| public boolean usesPadding() | |
| usesPaddingChar | back to summary |
|---|---|
| public boolean usesPaddingChar(char c) | |