Here you can find the source of writeResBit15(int value, ByteBuffer toBuffer)
static void writeResBit15(int value, ByteBuffer toBuffer)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { static void writeResBit15(int value, ByteBuffer toBuffer) { if (value < 0x80) { toBuffer.put((byte) value); } else {//from w w w. j a v a 2 s. c o m toBuffer.putShort((short) (value | 0x8000)); } } }