Here you can find the source of decodeBase64(char[] data)
public static byte[] decodeBase64(char[] data)
//package com.java2s; import java.io.ByteArrayOutputStream; public class Main { private static byte[] decodes = new byte[256]; public static byte[] decodeBase64(char[] data) { ByteArrayOutputStream baos = new ByteArrayOutputStream(data.length); int pos = 0, val = 0; for (int i = 0; i < data.length; i++) { val = (val << 6) | decodes[data[i]]; pos += 6;/*from w w w . ja va 2 s . c om*/ while (pos > 7) { baos.write(val >> (pos -= 8)); val &= ((1 << pos) - 1); } } return baos.toByteArray(); } }