Here you can find the source of bytesToLong(byte[] bytes, int index)
public static long bytesToLong(byte[] bytes, int index)
//package com.java2s; public class Main { public static long bytesToLong(byte[] bytes, int index) { return bytesToLong(bytes[index++], bytes[index++], bytes[index++], bytes[index++], bytes[index++], bytes[index++], bytes[index++], bytes[index++]); }/*from w w w.j a v a 2 s . c o m*/ public static long bytesToLong(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8) { long answer = 0xFFL & b8; answer = answer << 8 | (0xFF & b7); answer = answer << 8 | (0xFF & b6); answer = answer << 8 | (0xFF & b5); answer = answer << 8 | (0xFF & b4); answer = answer << 8 | (0xFF & b3); answer = answer << 8 | (0xFF & b2); answer = answer << 8 | (0xFF & b1); return answer; } }