@Override
    public void write(ExtendedCell cell) throws IOException {
      checkFlushed();
      CellProtos.Cell.Builder builder = CellProtos.Cell.newBuilder();
      // This copies bytes from Cell to ByteString. I don't see anyway around the copy.
      // ByteString is final.
      builder.setRow(UnsafeByteOperations.unsafeWrap(cell.getRowArray(), cell.getRowOffset(),
        cell.getRowLength()));
      builder.setFamily(UnsafeByteOperations.unsafeWrap(cell.getFamilyArray(),
        cell.getFamilyOffset(), cell.getFamilyLength()));
      builder.setQualifier(UnsafeByteOperations.unsafeWrap(cell.getQualifierArray(),
        cell.getQualifierOffset(), cell.getQualifierLength()));
      builder.setTimestamp(cell.getTimestamp());
      builder.setCellType(CellProtos.CellType.valueOf(cell.getTypeByte()));
      builder.setValue(UnsafeByteOperations.unsafeWrap(cell.getValueArray(), cell.getValueOffset(),
        cell.getValueLength()));
      CellProtos.Cell pbcell = builder.build();
      pbcell.writeDelimitedTo(this.out);
    }
Codec that just writes out Cell as a protobuf Cell Message. Does not write the mvcc stamp. Use a
different codec if you want that in the stream.
hbase-server/src/main/java/org/apache/hadoop/hbase/codec/MessageCodec.java