Here you can find the source of unsignedShortToInt(byte[] b)
public static final int unsignedShortToInt(byte[] b)
//package com.java2s; public class Main { public static final int unsignedShortToInt(byte[] b) { int i = 0; i |= b[0] & 0xFF;/*from w ww.j av a 2 s . c o m*/ i <<= 8; i |= b[1] & 0xFF; return i; } }