Here you can find the source of readBE(ByteBuffer bb, int elementWidth)
private static long readBE(ByteBuffer bb, int elementWidth)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { private static long readBE(ByteBuffer bb, int elementWidth) { final int p = bb.position(); long value = 0; for (int j = 0; j < elementWidth; j++) { value = (value << 8) | (bb.get(p + j) & 0xff); }/* w w w. jav a 2 s . c o m*/ bb.position(p + elementWidth); return value; } }