Here you can find the source of getUnsignedShort(final int offset, final byte[] buffer, final ByteOrder byteOrder)
public static final int getUnsignedShort(final int offset, final byte[] buffer, final ByteOrder byteOrder)
//package com.java2s; //License from project: Open Source License import java.nio.ByteOrder; public class Main { public static final int getUnsignedShort(final int offset, final byte[] buffer, final ByteOrder byteOrder) { if (byteOrder == ByteOrder.BIG_ENDIAN) { return (buffer[offset + 0] & 0xff) << 8 | buffer[offset + 1] & 0xff; }//from ww w. ja v a2 s. c o m return (buffer[offset + 1] & 0xff) << 8 | buffer[offset + 0] & 0xff; } }