public static byte[] decode(final String str, int inOffset, final int inLen)
    {
        if (inLen == 0)
            return new byte[0];

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

        int withoutPaddingLen = inLen, limit = inOffset + inLen;
        while (str.charAt(--limit) == pad)
            withoutPaddingLen--;

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

        decode(str, inOffset, inLen, output, 0, outLen);

        return output;
    }
Returns the base 64 decoded bytes. The provided {@code str} must already be base-64 encoded.
protostuff-api/src/main/java/io/protostuff/B64Code.java