public static void copy(byte[] src, int srcOffset, ByteBuffer dest, int destOffset, int length) {
    long destAddress = destOffset;
    Object destBase = null;
    if (dest.isDirect()) {
      destAddress = destAddress + directBufferAddress(dest);
    } else {
      destAddress = destAddress + BYTE_ARRAY_BASE_OFFSET + dest.arrayOffset();
      destBase = dest.array();
    }
    long srcAddress = srcOffset + BYTE_ARRAY_BASE_OFFSET;
    unsafeCopy(src, srcAddress, destBase, destAddress, length);
  }
Copies the bytes from given array's offset to length part into the given buffer.
@param src        source array
@param srcOffset  offset into source buffer
@param dest       destination buffer
@param destOffset offset into destination buffer
@param length     length of data to copy
hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java