Here you can find the source of writeBE(ByteBuffer bb, int elementWidth, long value)
private static void writeBE(ByteBuffer bb, int elementWidth, long value)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { private static void writeBE(ByteBuffer bb, int elementWidth, long value) { final int p = bb.position(); for (int j = 0; j < elementWidth; j++) { bb.put(p + j, (byte) value); value >>>= 8;/*w w w. j a v a 2 s . com*/ } bb.position(p + elementWidth); } }