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