Here you can find the source of BytesLEToShort(final byte[] buf)
public final static short BytesLEToShort(final byte[] buf)
//package com.java2s; //License from project: Creative Commons License public class Main { public final static short BytesLEToShort(final byte[] buf) { short val = 0x0; for (int i = 0; i < buf.length; i++) { val += ((short) buf[i] & 0xFF) << (8 * i); }/*from ww w . j a v a 2 s . c o m*/ return val; } }