Here you can find the source of getLong(byte[] src, boolean bigEndin)
static protected long getLong(byte[] src, boolean bigEndin)
//package com.java2s; public class Main { static protected long getLong(byte[] src, boolean bigEndin) { byte[] temp = { 0, 0, 0, 0, 0, 0, 0, 0 }; for (int i = 0; i < src.length; i++) { if (i > 7) break; temp[i] = src[i];//from www .j av a2s. co m } if (!bigEndin) { return makeLong(temp[7], temp[6], temp[5], temp[4], temp[3], temp[2], temp[1], temp[0]); } else { return makeLong(temp[4], temp[5], temp[6], temp[7], temp[0], temp[1], temp[2], temp[3]); } } static private long makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0) { return ((((long) b7 & 0xff) << 56) | (((long) b6 & 0xff) << 48) | (((long) b5 & 0xff) << 40) | (((long) b4 & 0xff) << 32) | (((long) b3 & 0xff) << 24) | (((long) b2 & 0xff) << 16) | (((long) b1 & 0xff) << 8) | (((long) b0 & 0xff) << 0)); } }