Here you can find the source of readBigEndianWord(byte[] buf)
public static short readBigEndianWord(byte[] buf)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static short readBigEndianWord(byte[] buf) { ByteBuffer bb = ByteBuffer.wrap(buf); bb.order(ByteOrder.BIG_ENDIAN); if (bb.hasRemaining()) { short v = bb.getShort(); return v; }/* w w w .ja va 2s .co m*/ return 0; } }