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 = 0L; num = (((long) ((bytes[0] & 0xFF)) << 56) | ((long) ((bytes[1] & 0xFF)) << 48) | ((long) ((bytes[2] & 0xFF)) << 40) | ((long) ((bytes[3] & 0xFF)) << 32) | ((long) ((bytes[4] & 0xFF)) << 24) | ((long) ((bytes[5] & 0xFF)) << 16) | ((long) ((bytes[6] & 0xFF)) << 8) | ((long) ((bytes[7] & 0xFF)))); return num; }/*from w w w . j ava2s.co m*/ }