Java examples for File Path IO:Byte Array
Returns 16 unsigned bits as an integer.
import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.util.Iterator; import org.apache.log4j.Logger; public class Main{ /**/*from w w w . j av a2 s . c o m*/ * Returns 16 unsigned bits as an integer. Big endian. * * @param buf * @return */ final public static int getUnsignedShort(ByteBuffer buf) { return buf.getShort() & 0xffff; } }