presto-rcfile/src/main/java/io/prestosql/rcfile/ChunkedSliceOutput.java/ChunkedSliceOutput/tryEnsureBatchSize
class ChunkedSliceOutput:    private int tryEnsureBatchSize(int length)
    {
        ensureWritableBytes(min(MAX_UNUSED_BUFFER_SIZE, length));
        return min(length, slice.length() - bufferPosition);
    }