|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.PingOO.DLAI.lib.util.Base64Codec
Provides encoding of raw bytes to base64-encoded characters, and decoding of base64 characters to raw bytes.
| Field Summary | |
private static char[] |
alphabet
Code characters for values 0..63 |
private static byte[] |
codes
lookup table for converting base64 characters to value in range 0..63 |
| Constructor Summary | |
private |
Base64Codec()
Hides the constructor from the outside. |
| Method Summary | |
static byte[] |
decode(char[] data)
Returns an array of bytes which were encoded in the passed character array. |
static byte[] |
decode(java.lang.String data)
Returns an array of bytes which were encoded in the passed String. |
static char[] |
encode(byte[] data)
Returns an array of base64-encoded characters to represent the passed data array. |
static char[] |
encode(char[] data)
Returns an array of base64-encoded characters to represent the passed data array. |
static char[] |
encode(java.lang.String data)
Returns an array of base64-encoded characters to represent the passed data String. |
private static void |
generateAlphabet()
Generates the base64 alphabet. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final char[] alphabet
private static byte[] codes
| Constructor Detail |
private Base64Codec()
| Method Detail |
private static final void generateAlphabet()
public static final char[] encode(byte[] data)
throws java.lang.NullPointerException
data - The array of bytes to encode.null.
public static final char[] encode(char[] data)
throws java.lang.NullPointerException
data - The array of char to encode.null.
public static final char[] encode(java.lang.String data)
throws java.lang.NullPointerException
toCharArray() method.data - The String to encode.null.
public static final byte[] decode(char[] data)
throws java.lang.NullPointerException
data - The array of base64-encoded characters.null.
public static final byte[] decode(java.lang.String data)
throws java.lang.NullPointerException
toCharArray() method.data - The array of base64-encoded characters.null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||