Here you can find the source of readResBit15(ByteBuffer fromBuffer)
static int readResBit15(ByteBuffer fromBuffer)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { static int readResBit15(ByteBuffer fromBuffer) { int b = readUnsignedByte(fromBuffer); if ((b & 0x80) != 0) { return (short) (((b & 0x7F) << 8) + readUnsignedByte(fromBuffer)); }//from ww w . j a v a 2s . co m return (short) b; } static int readUnsignedByte(ByteBuffer fromBuffer) { short val = fromBuffer.get(); if (val < 0) val &= 0xFF; return val; } }