Here you can find the source of getSmartOld(ByteBuffer in)
public static int getSmartOld(ByteBuffer in)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static int getSmartOld(ByteBuffer in) { int value = in.get() & 0xff; if (value < 128) return value; value = value << 8;/* w ww . j a va 2 s. c o m*/ value += (in.get() & 0xff); return value - 32768; } }