Here you can find the source of toLong(byte[] bytes)
public static long toLong(byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { public static long toLong(byte[] bytes) { long num = 0; if (bytes != null) { for (int i = bytes.length - 1, j = 0; i >= 0; i--, j++) { num += (long) (bytes[i] & 0xff) << (j * 8); }/* www. j ava2s . c om*/ } return num; } }