Here you can find the source of bytes_to_short(byte[] buf, int offset)
public static long bytes_to_short(byte[] buf, int offset)
//package com.java2s; //License from project: Open Source License public class Main { public static long bytes_to_short(byte[] buf, int offset) { return bytes_to_long(buf, offset); }//from w ww . j a va 2s.co m public static long bytes_to_long(byte[] buf, int offset) { return ((buf[offset] & 0xffL) << 24) + ((buf[offset + 1] & 0xffL) << 16) + ((buf[offset + 2] & 0xffL) << 8) + ((buf[offset + 3] & 0xffL)); } }