Here you can find the source of getShort(byte[] bytes)
public static short getShort(byte[] bytes)
//package com.java2s; public class Main { public static short getShort(byte[] bytes) { return (short) ((0xff & bytes[0]) | (0xff00 & (bytes[1] << 8))); }// w ww. ja va 2s.c om }