|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.Base64
Base64 encoding encodes 3 bytes into 4 characters.
Each set of 6 bits is encoded according to the
ASCII2BASE64 map.
This class also holds inner Input- and
OutputStream classes which are helpful when reading from /
writing to streams.
| Nested Class Summary | |
static class |
Base64.InputStream
Provides Base64 en- or decoding as an
InputStream. |
static class |
Base64.OutputStream
Provides Base64 en- and decoding as an
OutputStream. |
| Method Summary | |
static byte[] |
decode(java.lang.String input)
Decodes the given Base64 string to the matching byte array. |
protected static byte[] |
decode4to3(byte[] fourBytes)
Decodes 4 given bytes to 3 bytes using BASE64-decoding. |
protected static int |
decode4to3(byte[] source,
int srcOffset,
byte[] destination,
int destOffset)
Decodes 4 given bytes to 3 bytes using BASE64-decoding. |
static byte[] |
decodeRaw(byte[] in)
Decodes the given Base64 encoded bytes to the matching byte array. |
static java.lang.String |
encode(byte[] in)
Encodes the given byte array to the matching Base64
String. |
protected static byte[] |
encode3to4(byte[] threeBytes)
Encodes up to the first three bytes of array threeBytes and returns a four-byte array in Base64 notation. |
static byte[] |
toByteArray(int[] source)
Converts the given int array to a byte array.
|
static int[] |
toIntArray(byte[] source)
Converts the given byte array to an int array.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final java.lang.String encode(byte[] in)
byte array to the matching Base64
String.
in - the array to encode.
String.protected static byte[] encode3to4(byte[] threeBytes)
threeBytes - the byte array to convert.
public static final byte[] decode(java.lang.String input)
input - the String to decode.
byte array.public static final byte[] decodeRaw(byte[] in)
in - the bytes to decode.
byte array.protected static byte[] decode4to3(byte[] fourBytes)
BASE64-decoding.
fourBytes - an array holding the 4 bytes to decode.
protected static int decode4to3(byte[] source,
int srcOffset,
byte[] destination,
int destOffset)
BASE64-decoding.
source - the bytes to decode.srcOffset - an offset telling where to find the 4 bytes to decode.destination - an destination array for the decoded bytes.destOffset - an offset telling where to store the decoded bytes.
int.public static final byte[] toByteArray(int[] source)
int array to a byte array.
The returned arrays length is four times as large as the length of the
given one.
source - the int array to convert.
byte array.public static final int[] toIntArray(byte[] source)
byte array to an int array.
The returned arrays length is four times smaller than that of the given
one.
source - the byte array to convert.
int array.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||