|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.idoox.util.Base64
This class implements Base64 encoding.
byte[]
are encoded into following outputs:
encode(byte[])
, encode(byte[],boolean)
, encode(byte[],int,boolean)
.
encodeToString(byte[])
, encodeToString(byte[],boolean)
, encodeToString(byte[],int,boolean)
decode(byte[])
, decode(String)
Constructor Summary | |
Base64()
|
Method Summary | |
static byte[] |
decode(byte[] base64)
Decodes Base64 array to binary array. |
static byte[] |
decode(byte[] base64,
int baseLength)
Decodes Base64 array to binary array. |
static byte[] |
decode(java.lang.String encodedString)
Decodes string of Base64 encoded data into binary data. |
static byte[] |
encode(byte[] binary)
Encodes binary array to Base64 array. |
static byte[] |
encode(byte[] binary,
boolean newLines)
Encodes binary array to Base64 array. |
static byte[] |
encode(byte[] binary,
int length,
boolean newLines)
Encodes binary array to Base64 array. |
static byte[] |
encode(byte[] binary,
int off,
int length,
boolean newLines)
Encodes binary array to Base64 array. |
static java.lang.String |
encodeToString(byte[] binary)
Encodes binary data into Base64 String. |
static java.lang.String |
encodeToString(byte[] binary,
boolean newLines)
Encodes binary data into Base64 String. |
static java.lang.String |
encodeToString(byte[] binary,
int length,
boolean newLines)
Encodes starting length bytes of binary data into Base64 String. |
static boolean |
isValidBase64Byte(byte b)
Returns true for all bytes in range 'A' - 'Z', 'a' - 'z', '0' - '9', '+', '/', '='. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Base64()
Method Detail |
public static final boolean isValidBase64Byte(byte b)
b
- the byte to be checked.
public static byte[] encode(byte[] binary, boolean newLines)
binary
- input data to encodenewLines
- if set to true, a newLine is inserted after each 19 tripplets
java.lang.NullPointerException
- thrown if binary
is null
public static byte[] encode(byte[] binary, int length, boolean newLines)
binary
- input data to encodenewLines
- if set to true, a newLine is inserted after each 19 trippletslength
- sets length of the array to be encoded
java.lang.NullPointerException
- thrown if binary
is null
public static byte[] encode(byte[] binary, int off, int length, boolean newLines)
binary
- input data to encodenewLines
- if set to true, a newLine is inserted after each 19 trippletsoff
- offset in the input binary array where to startlength
- sets length of the array to be encoded
java.lang.NullPointerException
- thrown if binary
is null
public static byte[] decode(byte[] base64)
base64
- input data to decode
java.lang.NullPointerException
- thrown if binary
is null
public static byte[] decode(byte[] base64, int baseLength)
base64
- input data to decodebaseLength
- input data length
java.lang.NullPointerException
- thrown if binary
is null
public static byte[] encode(byte[] binary)
binary
- input data to encode
java.lang.NullPointerException
- thrown if binary
is null
public static java.lang.String encodeToString(byte[] binary)
binary
- binary data
java.lang.NullPointerException
- if binary
is null
.public static java.lang.String encodeToString(byte[] binary, boolean newLines)
newLines
is true
then output string has newline characters
after each 19 tripplets.
binary
- binary data
java.lang.NullPointerException
- if binary
is null
.public static java.lang.String encodeToString(byte[] binary, int length, boolean newLines)
length
bytes of binary data into Base64 String. If newLines
is true
then output string has newline characters
after each 19 tripplets.
binary
- binary datalength
- sets length of the binary data array to be encoded
java.lang.NullPointerException
- if binary
is null
.public static byte[] decode(java.lang.String encodedString)
encodedString
- Base64 string
java.lang.NullPointerException
- if encodedString
is null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |