code: static long getLong(byte[] buffer, int offset) {
          return (buffer[offset] & 0xffL) << 56 | (buffer[offset + 1] & 0xffL) << 48 | (buffer[offset + 2] & 0xffL) << 40
                  | (buffer[offset + 3] & 0xffL) << 32 | (buffer[offset + 4] & 0xffL) << 24
                  | (buffer[offset + 5] & 0xffL) << 16 | (buffer[offset + 6] & 0xffL) << 8 | (buffer[offset + 7] & 0xffL);
      }
docs: Converts eight bytes of a byte array to a signed long.
  <p/>
  The byte order is big-endian.
  
  @param buffer the byte array.
  @param offset the offset in the array.
  @return the long value.