presto-orc/src/main/java/io/prestosql/orc/stream/ByteInputStream.java/ByteInputStream/next
class ByteInputStream:    public void next(byte[] values, int items)
            throws IOException
    {
        int outputOffset = 0;
        while (outputOffset < items) {
            if (offset == length) {
                readNextBlock();
            }
            if (length == 0) {
                throw new OrcCorruptionException(input.getOrcDataSourceId(), "Unexpected end of stream");
            }

            int chunkSize = min(items - outputOffset, length - offset);
            System.arraycopy(buffer, offset, values, outputOffset, chunkSize);

            outputOffset += chunkSize;
            offset += chunkSize;
        }
    }