|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.util.common.util.Base64
public class Base64
Base64 converter class. This code is not a full-blown MIME encoder; it simply converts binary data to base64 data and back.
Field Summary | |
---|---|
static byte[] |
ALPHABET
The 64 valid Base64 values. |
static boolean |
DECODE
Specify decoding (value is false ). |
static boolean |
ENCODE
Specify encoding (value is true ). |
static byte[] |
WEBSAFE_ALPHABET
The 64 valid web safe Base64 values. |
Method Summary | |
---|---|
static byte[] |
decode(byte[] source)
Decodes Base64 content in byte array format and returns the decoded byte array. |
static byte[] |
decode(byte[] source,
int off,
int len)
Decodes Base64 content in byte array format and returns the decoded byte array. |
static byte[] |
decode(byte[] source,
int off,
int len,
byte[] decodabet)
Decodes Base64 content using the supplied decodabet and returns the decoded byte array. |
static byte[] |
decode(java.lang.String s)
Decodes data from Base64 notation. |
static byte[] |
decodeWebSafe(byte[] source)
Decodes web safe Base64 content in byte array format and returns the decoded data. |
static byte[] |
decodeWebSafe(byte[] source,
int off,
int len)
Decodes web safe Base64 content in byte array format and returns the decoded byte array. |
static byte[] |
decodeWebSafe(java.lang.String s)
Decodes data from web safe Base64 notation. |
static java.lang.String |
encode(byte[] source)
Encodes a byte array into Base64 notation. |
static java.lang.String |
encode(byte[] source,
int off,
int len,
byte[] alphabet,
boolean doPadding)
Encodes a byte array into Base64 notation. |
static byte[] |
encode(byte[] source,
int off,
int len,
byte[] alphabet,
int maxLineLength)
Encodes a byte array into Base64 notation. |
static java.lang.String |
encodeWebSafe(byte[] source,
boolean doPadding)
Encodes a byte array into web safe Base64 notation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean ENCODE
true
).
public static final boolean DECODE
false
).
public static final byte[] ALPHABET
public static final byte[] WEBSAFE_ALPHABET
Method Detail |
---|
public static java.lang.String encode(byte[] source)
encodeBytes(source, 0, source.length)
source
- The data to convertpublic static java.lang.String encodeWebSafe(byte[] source, boolean doPadding)
source
- The data to convertdoPadding
- is true
to pad result with '=' chars
if it does not fall on 3 byte boundariespublic static java.lang.String encode(byte[] source, int off, int len, byte[] alphabet, boolean doPadding)
source
- The data to convertoff
- Offset in array where conversion should beginlen
- Length of data to convertalphabet
- is the encoding alphabetdoPadding
- is true
to pad result with '=' chars
if it does not fall on 3 byte boundariespublic static byte[] encode(byte[] source, int off, int len, byte[] alphabet, int maxLineLength)
source
- The data to convertoff
- Offset in array where conversion should beginlen
- Length of data to convertalphabet
- is the encoding alphabetmaxLineLength
- maximum length of one line.
public static byte[] decode(java.lang.String s) throws Base64DecoderException
s
- the string to decode (decoded in default encoding)
Base64DecoderException
public static byte[] decodeWebSafe(java.lang.String s) throws Base64DecoderException
s
- the string to decode (decoded in default encoding)
Base64DecoderException
public static byte[] decode(byte[] source) throws Base64DecoderException
source
- The Base64 encoded data
Base64DecoderException
public static byte[] decodeWebSafe(byte[] source) throws Base64DecoderException
source
- the string to decode (decoded in default encoding)
Base64DecoderException
public static byte[] decode(byte[] source, int off, int len) throws Base64DecoderException
source
- The Base64 encoded dataoff
- The offset of where to begin decodinglen
- The length of characters to decode
Base64DecoderException
public static byte[] decodeWebSafe(byte[] source, int off, int len) throws Base64DecoderException
source
- The Base64 encoded dataoff
- The offset of where to begin decodinglen
- The length of characters to decode
Base64DecoderException
public static byte[] decode(byte[] source, int off, int len, byte[] decodabet) throws Base64DecoderException
source
- The Base64 encoded dataoff
- The offset of where to begin decodinglen
- The length of characters to decodedecodabet
- the decodabet for decoding Base64 content
Base64DecoderException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |