presto-orc/src/main/java/io/prestosql/orc/OrcOutputBuffer.java/OrcOutputBuffer/ensureBatchSize
class OrcOutputBuffer:    private int ensureBatchSize(int length)
    {
        ensureWritableBytes(min(DIRECT_FLUSH_SIZE, length));
        return min(length, slice.length() - bufferPosition);
    }