Here you can find the source of bytes2Short(byte[] input)
public static short bytes2Short(byte[] input)
//package com.java2s; //License from project: Apache License public class Main { public static short bytes2Short(byte[] input) { return (short) ((input[0] & 0xFF) | ((input[1] << 8) & 0xFF00)); }/*from ww w. j a v a 2 s . co m*/ }