Here you can find the source of getShort(byte[] data, int i, boolean bigEndian)
public static short getShort(byte[] data, int i, boolean bigEndian)
//package com.java2s; public class Main { public static short getShort(byte[] data, int i, boolean bigEndian) { if (bigEndian) return (short) ((data[i] << 8) + (data[i + 1] & 0xff)); else// w w w . ja va2 s . co m return (short) ((data[i + 1] << 8) + (data[i] & 0xff)); } }