Here you can find the source of byteArrayToLong(byte[] bArray)
public static long byteArrayToLong(byte[] bArray)
//package com.java2s; public class Main { public static long byteArrayToLong(byte[] bArray) { long a = 0; for (int i = 0; i < bArray.length; i++) { a += (long) ((bArray[i] & 0XFF) << (8 * i)); }// ww w . j ava 2 s .c o m return a; } }