public static int copyQualifierTo(Cell cell, ByteBuffer destination, int destinationOffset) {
    int qlen = cell.getQualifierLength();
    if (cell instanceof ByteBufferExtendedCell) {
      ByteBufferUtils.copyFromBufferToBuffer(
        ((ByteBufferExtendedCell) cell).getQualifierByteBuffer(), destination,
        ((ByteBufferExtendedCell) cell).getQualifierPosition(), destinationOffset, qlen);
    } else {
      ByteBufferUtils.copyFromArrayToBuffer(destination, destinationOffset,
        cell.getQualifierArray(), cell.getQualifierOffset(), qlen);
    }
    return destinationOffset + qlen;
  }
Copies the qualifier to the given bytebuffer
@param cell              the cell whose qualifier has to be copied
@param destination       the destination bytebuffer to which the qualifier has to be copied
@param destinationOffset the offset in the destination bytebuffer
@return the offset of the bytebuffer after the copy has happened
hbase-common/src/main/java/org/apache/hadoop/hbase/CellUtil.java