Here you can find the source of bytes2long(byte[] bytes)
public static long bytes2long(byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { public static long bytes2long(byte[] bytes) { long num = 0; for (int i = 0; i < 8; i++) { num <<= 8;/* w w w . j av a 2 s .c om*/ num |= (bytes[i] & 0xff); } return num; } }