presto-rcfile/src/main/java/io/prestosql/rcfile/binary/StructEncoding.java/StructEncoding/encodeValue
class StructEncoding:    @Override
    public void encodeValue(Block block, int position, SliceOutput output)
    {
        Block row = block.getObject(position, Block.class);

        // write values
        for (int batchStart = 0; batchStart < row.getPositionCount(); batchStart += 8) {
            int batchEnd = Math.min(batchStart + 8, structFields.size());

            int nullByte = 0;
            for (int fieldId = batchStart; fieldId < batchEnd; fieldId++) {
                if (!row.isNull(fieldId)) {
                    nullByte |= (1 << (fieldId % 8));
                }
            }
            output.writeByte(nullByte);
            for (int fieldId = batchStart; fieldId < batchEnd; fieldId++) {
                if (!row.isNull(fieldId)) {
                    BinaryColumnEncoding field = structFields.get(fieldId);
                    field.encodeValueInto(row, fieldId, output);
                }
            }
        }
    }