presto-rcfile/src/main/java/io/prestosql/rcfile/BufferedOutputStreamSliceOutput.java/BufferedOutputStreamSliceOutput/ensureBatchSize
class BufferedOutputStreamSliceOutput:    private int ensureBatchSize(int length)
    {
        ensureWritableBytes(Math.min(CHUNK_SIZE, length));
        return Math.min(length, CHUNK_SIZE - bufferPosition);
    }