code: public static long toLong(byte[] b) {
          return ((((long) b[7]) & 0xFF)
                  + ((((long) b[6]) & 0xFF) << 8)
                  + ((((long) b[5]) & 0xFF) << 16)
                  + ((((long) b[4]) & 0xFF) << 24)
                  + ((((long) b[3]) & 0xFF) << 32)
                  + ((((long) b[2]) & 0xFF) << 40)
                  + ((((long) b[1]) & 0xFF) << 48)
                  + ((((long) b[0]) & 0xFF) << 56));
      }
docs: Build a long from first 8 bytes of the array.
  
  @param b The byte[] to convert.
  @return A long.