public static long toInt(byte[] data) {

    assert (data.length <= 4);
    int v = 0;
    for (byte b : data) {
      v <<= 8;
      v = v | (b & 0x0FF);
    }
    return v;
  }
public static long toInt ( byte [ ] data ) { assert ( data . length <= 4 ) ; int v = 0 ; for ( byte b : data ) { v <<= 8 ; v = v | ( b & 0x0FF ) ; } return v ; }
@param data the long value as {@code byte[]} with a maximum length of 8 (see {@link #toBytes(long)}).
@return the value {@code long}.