public static long toLong(byte[] bytes, int offset) {
    if (LITTLE_ENDIAN) {
      return Long
        .reverseBytes(HBasePlatformDependent.getLong(bytes, offset + BYTE_ARRAY_BASE_OFFSET));
    } else {
      return HBasePlatformDependent.getLong(bytes, offset + BYTE_ARRAY_BASE_OFFSET);
    }
  }
Converts a byte array to a long value considering it was written in big-endian format.
@param bytes  byte array
@param offset offset into array
@return the long value
hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java