Here you can find the source of bytesToLong(byte[] inbytes, int shift)
public static long bytesToLong(byte[] inbytes, int shift)
//package com.java2s; public class Main { public static long bytesToLong(byte[] inbytes, int shift) { long result = 0; for (int i = 0 + shift; i < 8 + shift; i++) { result = (result << 8) + (inbytes[i] & 0xff); // [unsigned byte] }//from w w w .j a va 2s .co m return result; } }