public class Base64 extends Object
Note CharBase64 is a GWT-compatible implementation of this
class.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DECODE
Specify decoding (value is
false). |
static boolean |
ENCODE
Specify encoding (value is
true). |
| Modifier and Type | Method and Description |
|---|---|
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(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(String s)
Decodes data from web safe Base64 notation.
|
static String |
encode(byte[] source)
Encodes a byte array into Base64 notation.
|
static 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 String |
encodeWebSafe(byte[] source,
boolean doPadding)
Encodes a byte array into web safe Base64 notation.
|
public static final boolean ENCODE
true).public static final boolean DECODE
false).public static String encode(byte[] source)
encodeBytes(source, 0, source.length)source - The data to convertpublic static 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 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 - 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(String s) throws Base64DecoderException
s - the string to decode (decoded in default encoding)Base64DecoderExceptionpublic static byte[] decodeWebSafe(String s) throws Base64DecoderException
s - the string to decode (decoded in default encoding)Base64DecoderExceptionpublic static byte[] decode(byte[] source)
throws Base64DecoderException
source - The Base64 encoded dataBase64DecoderExceptionpublic static byte[] decodeWebSafe(byte[] source)
throws Base64DecoderException
source - the string to decode (decoded in default encoding)Base64DecoderExceptionpublic 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 decodeBase64DecoderExceptionpublic 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 decodeBase64DecoderExceptionpublic 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 contentBase64DecoderExceptionCopyright © 2016 Creative Mobile. All rights reserved.