public static byte[] encode(byte[] input, int inOffset, int inLen)
    {
        final byte[] output = new byte[((inLen + 2) / 3) * 4];
        encode(input, inOffset, inLen, output, 0);
        return output;
    }
Fast Base 64 encode as described in RFC 1421.
protostuff-api/src/main/java/io/protostuff/B64Code.java