Java Long Number From toLongInt(byte[] b)

Here you can find the source of toLongInt(byte[] b)

Description

to Long Int

License

Apache License

Declaration

public static long toLongInt(byte[] b) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static long toLongInt(byte[] b) {
        if (b.length > 8)
            throw new NumberFormatException("long has only 8 bytes");
        long i = 0;
        for (byte x : b) {
            i <<= 8;/*w ww . j av  a 2s . com*/
            i |= (x & 0xFF);
        }
        return i;
    }
}

Related

  1. toLongBE(byte[] src, int offset)
  2. toLongDate()
  3. toLongDefaultIfNull(Long configured, long theDefault)
  4. toLongExactWithoutOverflow(float value)
  5. toLongId(Integer i)
  6. toLongitude(long fsuipcLongitude)
  7. toLongitude(String latLng)
  8. toLongLE(byte target[], int offset, int numBytes, long value)
  9. toLongList(String valus)