HeapTuple implements Tuple { public HeapTuple(final byte [] bytes, final DataType [] types) { this.data = bytes; this.types = types; } HeapTuple(final byte [] bytes, final DataType [] types); @Override int size(); ByteBuffer nioBuffer(); @Override boolean contains(int fieldid); @Override boolean isNull(int fieldid); @Override boolean isNotNull(int fieldid); @Override void clear(); @Override void put(int fieldId, Datum value); @Override void put(int fieldId, Datum[] values); @Override void put(int fieldId, Tuple tuple); @Override void put(Datum[] values); @Override Datum get(int fieldId); @Override void setOffset(long offset); @Override long getOffset(); @Override boolean getBool(int fieldId); @Override byte getByte(int fieldId); @Override char getChar(int fieldId); @Override byte[] getBytes(int fieldId); @Override short getInt2(int fieldId); @Override int getInt4(int fieldId); @Override long getInt8(int fieldId); @Override float getFloat4(int fieldId); @Override double getFloat8(int fieldId); @Override String getText(int fieldId); IntervalDatum getInterval(int fieldId); @Override Datum getProtobufDatum(int fieldId); @Override char[] getUnicodeChars(int fieldId); @Override Tuple clone(); @Override Datum[] getValues(); @Override String toString();  }
@Test public void testHeapTuple() { OffHeapRowBlock rowBlock = TestOffHeapRowBlock.createRowBlock(1024); OffHeapRowBlockReader reader = new OffHeapRowBlockReader(rowBlock); ZeroCopyTuple zcTuple = new ZeroCopyTuple(); int i = 0; while (reader.next(zcTuple)) { byte [] bytes = new byte[zcTuple.nioBuffer().limit()]; zcTuple.nioBuffer().get(bytes); HeapTuple heapTuple = new HeapTuple(bytes, SchemaUtil.toDataTypes(TestOffHeapRowBlock.schema)); TestOffHeapRowBlock.validateTupleResult(i, heapTuple); i++; } rowBlock.release(); }