code: public static long readLong(byte b[], int offset) {
      long retValue;
  
      retValue = ((long)b[offset++]) << 56;
      retValue |= ((long)b[offset++] & 0xff) << 48;
      retValue |= ((long)b[offset++] & 0xff) << 40;
      retValue |= ((long)b[offset++] & 0xff) << 32;
      retValue |= ((long)b[offset++] & 0xff) << 24;
      retValue |= ((long)b[offset++] & 0xff) << 16;
      retValue |= ((long)b[offset++] & 0xff) << 8;
      retValue |= (long)b[offset] & 0xff;
  
      return retValue;
    }
docs: Unserializes a long from a byte array at a specific offset in big-endian order
  
  @param b byte array from which to read a long value.
  @param offset offset within byte array to start reading.
  @return long read from byte array.