code: public static final long getLong(byte[] data, int offset)
     {
        long result = 0;
        int i = offset;
        for (int shiftBy = 0; shiftBy < 64; shiftBy += 8)
        {
           result |= ((long) (data[i] & 0xff)) << shiftBy;
           ++i;
        }
        return result;
     }
docs: Read a long int from a byte array.
  
  @param data byte array
  @param offset start offset
  @return long value