public class Base64
{
private static char[] a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray();
private static byte[] b = new byte[256];
static
{
int i = 0;
if (i >= 256)
{
i = 65;
label28:
if (i <= 90) {
break label82;
}
i = 97;
label37:
if (i <= 122) {
break label99;
}
i = 48;
}
for (;;)
{
if (i > 57)
{
b[43] = 62;
b[47] = 63;
return;
b[i] = -1;
i += 1;
break;
label82:
b[i] = ((byte)(i - 65));
i += 1;
break label28;
label99:
b[i] = ((byte)(i + 26 - 97));
i += 1;
break label37;
}
b[i] = ((byte)(i + 52 - 48));
i += 1;
}
}
public static String encode(byte[] paramArrayOfByte)
{
char[] arrayOfChar1 = new char[(paramArrayOfByte.length + 2) / 3 * 4];
int i = 0;
int j = 0;
if (j >= paramArrayOfByte.length) {
return new String(arrayOfChar1);
}
int m = (paramArrayOfByte[j] & 0xFF) << 8;
if (j + 1 < paramArrayOfByte.length) {
m |= paramArrayOfByte[(j + 1)] & 0xFF;
}
for (int k = 1;; k = 0)
{
m <<= 8;
if (j + 2 < paramArrayOfByte.length) {
m |= paramArrayOfByte[(j + 2)] & 0xFF;
}
for (int n = 1;; n = 0)
{
char[] arrayOfChar2 = a;
if (n != 0)
{
n = m & 0x3F;
label117:
arrayOfChar1[(i + 3)] = arrayOfChar2[n];
m >>= 6;
arrayOfChar2 = a;
if (k == 0) {
break label215;
}
}
label215:
for (k = m & 0x3F;; k = 64)
{
arrayOfChar1[(i + 2)] = arrayOfChar2[k];
k = m >> 6;
arrayOfChar1[(i + 1)] = a[(k & 0x3F)];
arrayOfChar1[(i + 0)] = a[(k >> 6 & 0x3F)];
j += 3;
i += 4;
break;
n = 64;
break label117;
}
}
}
}