Decodes the supplied Base-64 encoded string.
int length = string.length();
if (length == 0) return new byte[0];
int pad = (string.charAt(length - 2) == '=") ? 2 :
(string.charAt(length - 1) == '=") ? 1 : 0;
int size = length * 3 / 4 - pad;
byte[] buffer = new byte[size];
int block;
int i = 0;
int index = 0;
while (i < length) {
block = (ALPHABET.indexOf(string.charAt(i++)) & 0xff) << 18 |
(ALPHABET.indexOf(string.charAt(i++)) & 0xff) << 12 |
(ALPHABET.indexOf(string.charAt(i++)) & 0xff) << 6 |
(ALPHABET.indexOf(string.charAt(i++)) & 0xff);
buffer[index++] = (byte) (block >>> 16);
if (index < size) buffer[index++] = (byte) ((block >>> 8) & 0xff);
if (index < size) buffer[index++] = (byte) (block & 0xff);
}
return buffer;