presto-orc/src/main/java/io/prestosql/orc/stream/CompressedOrcChunkLoader.java/CompressedOrcChunkLoader/ensureCompressedBytesAvailable
class CompressedOrcChunkLoader:    private void ensureCompressedBytesAvailable(int size)
            throws IOException
    {
        // is this within the current buffer?
        if (size <= compressedBufferStream.remaining()) {
            return;
        }

        // is this a read larger than the buffer
        if (size > dataReader.getMaxBufferSize()) {
            throw new OrcCorruptionException(dataReader.getOrcDataSourceId(), "Requested read size (%s bytes) is greater than max buffer size (%s bytes", size, dataReader.getMaxBufferSize());
        }

        // is this a read past the end of the stream
        if (compressedBufferStart + compressedBufferStream.position() + size > dataReader.getSize()) {
            throw new OrcCorruptionException(dataReader.getOrcDataSourceId(), "Read past end of stream");
        }

        compressedBufferStart = compressedBufferStart + toIntExact(compressedBufferStream.position());
        Slice compressedBuffer = dataReader.seekBuffer(compressedBufferStart);
        dataReaderMemoryUsage.setBytes(dataReader.getRetainedSize());
        if (compressedBuffer.length() < size) {
            throw new OrcCorruptionException(dataReader.getOrcDataSourceId(), "Requested read of %s bytes but only %s were bytes", size, compressedBuffer.length());
        }
        compressedBufferStream = compressedBuffer.getInput();
    }