Here you can find the source of toShort(byte[] readBuffer, int o)
public static short toShort(byte[] readBuffer, int o)
//package com.java2s; //License from project: Open Source License public class Main { public static short toShort(byte[] readBuffer, int o) { return (short) (((readBuffer[o + 0] & 255) << 8) + ((readBuffer[o + 1] & 255) << 0)); }//from w ww. j ava2 s .com public static short toShort(byte[] readBuffer) { return toShort(readBuffer, 0); } }