presto-rcfile/src/main/java/io/prestosql/rcfile/ChunkedSliceOutput.java/ChunkedSliceOutput/ensureWritableBytes
class ChunkedSliceOutput:    private void ensureWritableBytes(int minWritableBytes)
    {
        checkArgument(minWritableBytes <= MAX_UNUSED_BUFFER_SIZE);
        if (bufferPosition + minWritableBytes > slice.length()) {
            closeChunk();
        }
    }