code: public static long readLong(byte[] buf, int pos) {
      checkBoundary(buf, pos, 8);
      return (((long) (buf[pos++] & 0xff) << 56) | ((long) (buf[pos++] & 0xff) << 48)
          | ((long) (buf[pos++] & 0xff) << 40) | ((long) (buf[pos++] & 0xff) << 32)
          | ((long) (buf[pos++] & 0xff) << 24) | ((long) (buf[pos++] & 0xff) << 16)
          | ((long) (buf[pos++] & 0xff) << 8) | ((long) (buf[pos] & 0xff)));
    }
docs: Reads a specific long byte value (8 bytes) from the input byte array at the given offset.
  
  @param buf input byte buffer
  @param pos offset into the byte buffer to read
  @return the long value read