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

byte[]base64Decode(String data)
Decodes the specified String into a byte array assuming that the string is Base64 encoded.
byte[] d = Base64.getDecoder().decode(data.getBytes());
return d;
byte[]base64Decode(String input)
base Decode
if (input.length() % 4 != 0) {
    throw new IllegalArgumentException("Invalid base64 input");
byte decoded[] = new byte[((input.length() * 3) / 4)
        - (input.indexOf('=') > 0 ? (input.length() - input.indexOf('=')) : 0)];
char[] inChars = input.toCharArray();
int j = 0;
int b[] = new int[4];
...
byte[]base64Decode(String s)
Traduce un String en Base64 a un Arreglo de bytes
int delta = s.endsWith("==") ? 2 : s.endsWith("=") ? 1 : 0;
byte[] buffer = new byte[s.length() * 3 / 4 - delta];
int mask = 0xFF;
int index = 0;
for (int i = 0; i < s.length(); i += 4) {
    int c0 = toInt[s.charAt(i)];
    int c1 = toInt[s.charAt(i + 1)];
    buffer[index++] = (byte) (((c0 << 2) | (c1 >> 4)) & mask);
...
Stringbase64Decode(String s)
base Decode
try {
    return new String(new BASE64Decoder().decodeBuffer(s));
} catch (IOException e) {
    throw new RuntimeException(e);
byte[]base64Decode(String s)
Decodes a byte array from Base64 format.
char[] in = s.toCharArray();
int iOff = 0;
int iLen = s.toCharArray().length;
if (iLen % 4 != 0)
    throw new IllegalArgumentException("Length of Base64 encoded input string is not a multiple of 4.");
while (iLen > 0 && in[iOff + iLen - 1] == '=')
    iLen--;
int oLen = (iLen * 3) / 4;
...
byte[]base64decode(String s)
basedecode
return base64decode(s.getBytes());
Stringbase64Decode(String str)
Decodes the given string using the base64-encoding specified in RFC-2045 (Section 6.8).
if (str == null)
    return null;
sun.misc.BASE64Decoder dec = new sun.misc.BASE64Decoder();
String decodedString = null;
try {
    decodedString = new String(dec.decodeBuffer(new ByteArrayInputStream(str.getBytes())));
} catch (java.io.IOException e) {
    e.printStackTrace();
...
byte[]base64Decode(String str)
base Decode
byte[] bt = null;
try {
    sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
    bt = decoder.decodeBuffer(str);
} catch (IOException e) {
    e.printStackTrace();
return bt;
...
byte[]Base64Decode(String str)
Base Decode
return new BASE64Decoder().decodeBuffer(str);
byte[]base64Decode(String str)
base Decode
StringBuffer sb = new StringBuffer();
byte[] data = str.getBytes("US-ASCII");
int len = data.length;
int i = 0;
int b1, b2, b3, b4;
while (i < len) {
    do {
        b1 = base64DecodeChars[data[i++]];
...