public static int copyValueTo(Cell cell, byte[] destination, int destinationOffset) {
    int vlen = cell.getValueLength();
    if (cell instanceof ByteBufferExtendedCell) {
      ByteBufferUtils.copyFromBufferToArray(destination,
        ((ByteBufferExtendedCell) cell).getValueByteBuffer(),
        ((ByteBufferExtendedCell) cell).getValuePosition(), destinationOffset, vlen);
    } else {
      System.arraycopy(cell.getValueArray(), cell.getValueOffset(), destination, destinationOffset,
        vlen);
    }
    return destinationOffset + vlen;
  }
Copies the value to the given byte[]
@param cell              the cell whose value has to be copied
@param destination       the destination byte[] to which the value 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