Here you can find the source of byteToLong(byte[] byteArray)
public static long byteToLong(byte[] byteArray)
//package com.java2s; //License from project: Open Source License public class Main { public static long byteToLong(byte[] byteArray) { return (((long) (byteArray[0]) & 0xFF) << 56) | (((long) (byteArray[1]) & 0xFF) << 48) | (((long) (byteArray[2]) & 0xFF) << 40) | (((long) (byteArray[3]) & 0xFF) << 32) | (((long) (byteArray[4]) & 0xFF) << 24) | (((long) (byteArray[5]) & 0xFF) << 16) | (((long) (byteArray[6]) & 0xFF) << 8) | ((long) (byteArray[7]) & 0xFF); }/*from ww w. j av a 2s. com*/ }