Here you can find the source of byteArray2Short(byte[] b)
public static final int byteArray2Short(byte[] b)
//package com.java2s; public class Main { public static final int byteArray2Short(byte[] b) { return (b[0] << 8) + (b[1] & 0xFF); }// w w w. jav a2 s . c o m }