Here you can find the source of readCInt(ByteBuffer buffer)
public static final int readCInt(ByteBuffer buffer)
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; public class Main { public static final int readCInt(ByteBuffer buffer) { final byte head = buffer.get(); // -128 = short byte, -127 == 4 byte if (head > -127 && head <= 127) { return head; }//from w w w . ja v a 2s .co m if (head == -128) { return buffer.getShort(); } else { return buffer.getInt(); } } }