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) { return (((long) data[0] << 56) + ((long) (data[1] & 255) << 48) + ((long) (data[2] & 255) << 40) + ((long) (data[3] & 255) << 32) + ((long) (data[4] & 255) << 24) + ((data[5] & 255) << 16) + ((data[6] & 255) << 8) + ((data[7] & 255) << 0)); }//from www . jav a 2 s. c o m }