Here you can find the source of toBigEndianShort(byte[] b, int pos)
public static short toBigEndianShort(byte[] b, int pos)
//package com.java2s; public class Main { public static short toBigEndianShort(byte[] b, int pos) { short ret = 0; ret |= (b[pos] & 0xFF) << 8; ret |= (b[pos + 1] & 0xFF);//from w ww . j a va 2 s.com return ret; } }