public static void writeRow(OutputStream out, Cell cell, short rlength) throws IOException {
    if (cell instanceof ByteBufferExtendedCell) {
      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferExtendedCell) cell).getRowByteBuffer(),
        ((ByteBufferExtendedCell) cell).getRowPosition(), rlength);
    } else {
      out.write(cell.getRowArray(), cell.getRowOffset(), rlength);
    }
  }
Writes the row from the given cell to the output stream
@param out     The outputstream to which the data has to be written
@param cell    The cell whose contents has to be written
@param rlength the row length
hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java