Here you can find the source of toLong(byte[] data)
public static long toLong(byte[] data)
//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*/ }