Here you can find the source of bytesToXBigEndian(byte[] in, int offset, int size)
public static long bytesToXBigEndian(byte[] in, int offset, int size)
//package com.java2s; public class Main { public static long bytesToXBigEndian(byte[] in, int offset, int size) { if (in == null) { throw new NullPointerException("in == null"); }// w ww . j ava2 s.co m long res = 0; for (int i = offset; i < (offset + size); i++) { res = (res << 8) | (in[i] & 0xff); } return res; } }