Here you can find the source of toLong(byte[] bytes)
public static long toLong(byte[] bytes)
//package com.java2s; // The MIT License (MIT) public class Main { public static long toLong(byte[] bytes) { // @formatter:off return (bytes[0] & 0xffL) << 56 | (bytes[1] & 0xffL) << 48 | (bytes[2] & 0xffL) << 40 | (bytes[3] & 0xffL) << 32 | (bytes[4] & 0xffL) << 24 | (bytes[5] & 0xffL) << 16 | (bytes[6] & 0xffL) << 8 | (bytes[7] & 0xffL); // @formatter:on }/*from w w w.java 2 s . c o m*/ }