Here you can find the source of toLongInt(byte[] b)
public static long toLongInt(byte[] b)
//package com.java2s; //License from project: Apache License public class Main { public static long toLongInt(byte[] b) { if (b.length > 8) throw new NumberFormatException("long has only 8 bytes"); long i = 0; for (byte x : b) { i <<= 8;/*w ww . j av a 2s . com*/ i |= (x & 0xFF); } return i; } }