Here you can find the source of byteToLong(byte[] b)
public static long byteToLong(byte[] b)
//package com.java2s; public class Main { public static long byteToLong(byte[] b) { if (b.length != 8) { return -1; }/*from w w w . j a v a 2 s . c om*/ return ((((long) b[0] & 0xff) << 56) | (((long) b[1] & 0xff) << 48) | (((long) b[2] & 0xff) << 40) | (((long) b[3] & 0xff) << 32) | (((long) b[4] & 0xff) << 24) | (((long) b[5] & 0xff) << 16) | (((long) b[6] & 0xff) << 8) | (((long) b[7] & 0xff) << 0)); } }