code: public static long bytesToLong(byte[] bytes, int offset) {
          long result = 0x0;
          for (int i = offset; i < offset + 8; ++i) {
              result = result << 8;
              result |= (bytes[i] & 0x00000000000000FFl);
          }
          return result;
      }
docs: A utility method to convert the long from the byte array to a long.
  
  @param bytes
  The byte array containing the long.
  @param offset
  The index at which the long is located.
  @return The long value.