public int readRawVarInt32() throws IOException {
        int position = nioBuffer.position();
        byte tmp = UnsafeDirectBufferUtil.getByte(address(position++));
        if (tmp >= 0) {
            nioBuffer.position(position);
            return tmp;
        }
        int result = tmp & 0x7f;
        if ((tmp = UnsafeDirectBufferUtil.getByte(address(position++))) >= 0) {
            result |= tmp << 7;
        } else {
            result |= (tmp & 0x7f) << 7;
            if ((tmp = UnsafeDirectBufferUtil.getByte(address(position++))) >= 0) {
                result |= tmp << 14;
            } else {
                result |= (tmp & 0x7f) << 14;
                if ((tmp = UnsafeDirectBufferUtil.getByte(address(position++))) >= 0) {
                    result |= tmp << 21;
                } else {
                    result |= (tmp & 0x7f) << 21;
                    result |= (tmp = UnsafeDirectBufferUtil.getByte(address(position++))) << 28;
                    if (tmp < 0) {
                        // Discard upper 32 bits.
                        for (int i = 0; i < 5; i++) {
                            if (UnsafeDirectBufferUtil.getByte(address(position++)) >= 0) {
                                nioBuffer.position(position);
                                return result;
                            }
                        }
                        throw ProtocolException.malformedVarInt();
                    }
                }
            }
        }
        nioBuffer.position(position);
        return result;
    }
Reads a var int 32 from the internal byte buffer.
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/serialization/impl/protostuff/io/UnsafeNioBufInput.java