private int createCellReference(ByteBufferKeyValue cell, ByteBuffer idxBuffer, int idxOffset) {
    int offset = idxOffset;
    int dataChunkID = cell.getChunkId();

    offset = ByteBufferUtils.putInt(idxBuffer, offset, dataChunkID); // write data chunk id
    offset = ByteBufferUtils.putInt(idxBuffer, offset, cell.getOffset()); // offset
    offset = ByteBufferUtils.putInt(idxBuffer, offset, cell.getSerializedSize()); // length
    offset = ByteBufferUtils.putLong(idxBuffer, offset, cell.getSequenceId()); // seqId

    return offset;
  }
------------------------------------------------------------------------ C-tor to be used when
new CellChunkImmutableSegment is built as a result of flattening of CSLMImmutableSegment The
given iterator returns the Cells that "survived" the compaction.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellChunkImmutableSegment.java