Java Utililty Methods Base64 Decode

List of utility methods to do Base64 Decode

Description

The list of methods to do Base64 Decode are organized into topic(s).

Method

Stringbase64decode(String str)
basedecode
int len = str.length();
if ((len & 3) != 0)
    throw new IllegalArgumentException("Not Base64: " + str);
int padstart = str.indexOf('=', len - 3);
int padding = padstart == -1 ? 0 : len - padstart;
byte[] utf8 = new byte[len / 4 * 3];
for (int i = 0; i < len / 4; i++) {
    int value = (revBase64[str.charAt(4 * i)] << 18) + (revBase64[str.charAt(4 * i + 1)] << 12)
...
byte[]base64Decode(String string)
Decodes the supplied base 64 encoded string into its original byte array, using the standard base 64 decoding algorithm.
string = string.replace("\n", "");
string = string.replace("\r", "");
char[] chars = string.toCharArray();
int i = 0;
int charsToWrite = chars.length;
ByteArrayOutputStream buff = new ByteArrayOutputStream(chars.length);
byte[] b = new byte[4];
while (charsToWrite >= 4) {
...
byte[]base64decode(String string)
basedecode
int len = string.length();
int iter = len - (len % 4);
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int i = 0;
for (; i < iter; i += 4) {
    byte a = b64reverseTable[string.charAt(i)];
    byte b = b64reverseTable[string.charAt(i + 1)];
    byte c = b64reverseTable[string.charAt(i + 2)];
...
Stringbase64decode(String strMi)
basedecode
BASE64Decoder base64de = new BASE64Decoder();
try {
    return new String(base64de.decodeBuffer(strMi));
} catch (IOException e) {
    e.printStackTrace();
    System.err.println("Cannot decode " + strMi);
    return "";
Stringbase64decode(String text)
basedecode
try {
    return new String(dec.decodeBuffer(text), DEFAULT_ENCODING);
} catch (IOException e) {
    return null;
byte[]base64decodebyte(String txt)
basedecodebyte
byte[] buf = null;
if (txt != null && txt.length() > 0) {
    try {
        buf = new sun.misc.BASE64Decoder().decodeBuffer(txt);
    } catch (IOException ex) {
return buf;
...
byte[]base64Decoder(char[] src, int start)
base Decoder
if (src == null || src.length == 0)
    return null;
char[] four = new char[4];
int i = 0, l, aux;
char c;
boolean padded;
ByteArrayOutputStream dst = new ByteArrayOutputStream(src.length >> 1);
while (start < src.length) {
...
Stringbase64decodeString(String inputString)
Decodes a String which is base64 encoded.
if (inputString == null)
    return "";
return new String(Base64.getDecoder().decode(inputString));
byte[]decode(String base64)
decode
return Base64Decode(base64);
byte[]decode(String base64Code)
decode
if (base64Code == null) {
    return null;
try {
    return new sun.misc.BASE64Decoder().decodeBuffer(base64Code);
} catch (IOException exception) {
    return null;