Here you can find the source of toLong(byte[] b, int pos, int width)
public static long toLong(byte[] b, int pos, int width)
//package com.java2s; public class Main { public static long toLong(byte[] b, int pos) { return toLong(b, pos, 8); }/* www . j av a 2 s . c o m*/ public static long toLong(byte[] b, int pos, int width) { long ret = 0; for (int i = 0; i < width; i++) { ret |= (b[i + pos] & 0xFFl) << (8 * i); } return ret; } }