Here you can find the source of toUnsignedInt16(byte[] bytes)
public static int toUnsignedInt16(byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { public static int toUnsignedInt16(byte[] bytes) { return ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); }//from w w w . j a v a 2 s. c om }