Here you can find the source of readUInt16(ByteBuffer bb)
public static int readUInt16(ByteBuffer bb) throws IOException
//package com.java2s; //License from project: LGPL import java.io.IOException; import java.nio.ByteBuffer; public class Main { public static int readUInt16(ByteBuffer bb) throws IOException { return (bb.getShort() & 0xffff); }//from w w w . ja va 2 s . com }