Java Long Number Create toLong(byte[] data)

Here you can find the source of toLong(byte[] data)

Description

to Long

License

Apache License

Declaration

public static long toLong(byte[] data) 

Method Source Code

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

public class Main {
    public static long toLong(byte[] data) {
        if (data.length != 8)
            return 0;
        return (long) data[0] << 56 | (long) data[1] << 48 | (long) data[2] << 40 | (long) data[3] << 32
                | (int) data[4] << 24 | (int) data[5] << 16 | (int) data[6] << 8 | (int) data[7];
    }/*from   ww  w .  j  a  v  a2  s  .  c o m*/
}

Related

  1. ToLong(byte[] bytes, int offset)
  2. toLong(byte[] bytes, int offset)
  3. toLong(byte[] bytes, int offset)
  4. toLong(byte[] data)
  5. toLong(byte[] data)
  6. toLong(byte[] data)
  7. toLong(byte[] in)
  8. toLong(byte[] input)
  9. toLong(byte[] key)