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