public void writeFieldTo(int ordinal, ByteBuffer buffer) {
        final long offsetAndSize = getLong(ordinal);
        final int offset = (int) (offsetAndSize >> 32);
        final int size = (int) offsetAndSize;

        buffer.putInt(size);
        int pos = buffer.position();
        buffer.position(pos + size);
        Platform.copyMemory(
                baseObject,
                baseOffset + offset,
                buffer.array(),
                Platform.BYTE_ARRAY_OFFSET + buffer.arrayOffset() + pos,
                size);
    }
Write the bytes of var-length field into ByteBuffer

Note: only work with HeapByteBuffer
indexr-query-opt/src/main/java/io/indexr/query/row/UnsafeRow.java