public static byte[] cdecode(final char[] input, int inOffset, final int inLen)
    {
        if (inLen == 0)
            return ByteString.EMPTY_BYTE_ARRAY;

        if (inLen % 4 != 0)
            throw new IllegalArgumentException("Input block size is not 4");

        int withoutPaddingLen = inLen, limit = inOffset + inLen;
        while (input[--limit] == pad)
            withoutPaddingLen--;

        // Create result array of exact required size.
        final int outLen = ((withoutPaddingLen) * 3) / 4;
        final byte[] output = new byte[outLen];

        cdecode(input, inOffset, inLen, output, 0, outLen);

        return output;
    }
Fast Base 64 decode as described in RFC 1421.
<p>
Does not attempt to cope with extra whitespace as described in RFC 1521.
<p>
Avoids creating extra copies of the input/output.
<p>
Note this code has been flattened for performance.

@param input
           char array to decode.
@param inOffset
           the offset.
@param inLen
           the length.
@return byte array containing the decoded form of the input.
@throws IllegalArgumentException
            if the input is not a valid B64 encoding.
protostuff-api/src/main/java/io/protostuff/B64Code.java