public static int copyRowTo(Cell cell, byte[] destination, int destinationOffset) {
    short rowLen = cell.getRowLength();
    if (cell instanceof ByteBufferExtendedCell) {
      ByteBufferUtils.copyFromBufferToArray(destination,
        ((ByteBufferExtendedCell) cell).getRowByteBuffer(),
        ((ByteBufferExtendedCell) cell).getRowPosition(), destinationOffset, rowLen);
    } else {
      System.arraycopy(cell.getRowArray(), cell.getRowOffset(), destination, destinationOffset,
        rowLen);
    }
    return destinationOffset + rowLen;
  }
Copies the row to the given byte[]
@param cell              the cell whose row has to be copied
@param destination       the destination byte[] to which the row has to be copied
@param destinationOffset the offset in the destination byte[]
@return the offset of the byte[] after the copy has happened
hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java