@Override
    public int read(byte[] b, int off, int len) throws IOException {
        int i;
        for (i = 0; i < len; ++i) {
            int ch = read();
            if (ch == -1) {
                break;
            }
            b[off + i] = (byte) ch;
        }
        if (i == 0) {
            return -1;
        }
        return i;
    }
Parse an AWS v4 signature chunked stream.  Reference:
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
src/main/java/org/gaul/s3proxy/ChunkedInputStream.java