presto-spi/src/main/java/io/prestosql/spi/block/RunLengthBlockEncoding.java/RunLengthBlockEncoding/writeBlock
class RunLengthBlockEncoding:    @Override
    public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block)
    {
        RunLengthEncodedBlock rleBlock = (RunLengthEncodedBlock) block;

        // write the run length
        sliceOutput.writeInt(rleBlock.getPositionCount());

        // write the value
        blockEncodingSerde.writeBlock(sliceOutput, rleBlock.getValue());
    }