code: public static long convertBytesToLong(byte[] bytes, int offset)
      {
          long value = 0;
          for (int i = offset; i < offset + 8; i++)
          {
              byte b = bytes[i];
              value <<= 8;
              value |= b;
          }
          return value;
  
      }
docs: Utility method to convert an array of bytes into a long.  Byte ordered is
  assumed to be big-endian.
  @param bytes The data to read from.
  @param offset The position to start reading the 8-byte long from.
  @return The 64-bit integer represented by the eight bytes.
  @since 1.1