public int readSignedInt() {
        int variableByteDecode = 0;
        byte variableByteShift = 0;

        // check if the continuation bit is set
        while ((this.bufferData[this.bufferPosition] & 0x80) != 0) {
            variableByteDecode |= (this.bufferData[this.bufferPosition++] & 0x7f) << variableByteShift;
            variableByteShift += 7;
        }

        // read the six data bits from the last byte
        if ((this.bufferData[this.bufferPosition] & 0x40) != 0) {
            // negative
            return -(variableByteDecode | ((this.bufferData[this.bufferPosition++] & 0x3f) << variableByteShift));
        }
        // positive
        return variableByteDecode | ((this.bufferData[this.bufferPosition++] & 0x3f) << variableByteShift);
    }
public int readSignedInt ( ) { int variableByteDecode = 0 ; byte variableByteShift = 0 ; while ( ( this . bufferData [ this . bufferPosition ] & 0x80 ) != 0 ) { variableByteDecode |= ( this . bufferData [ this . bufferPosition ++ ] & 0x7f ) << variableByteShift ; variableByteShift += 7 ; } if ( ( this . bufferData [ this . bufferPosition ] & 0x40 ) != 0 ) { return - ( variableByteDecode | ( ( this . bufferData [ this . bufferPosition ++ ] & 0x3f ) << variableByteShift ) ) ; } return variableByteDecode | ( ( this . bufferData [ this . bufferPosition ++ ] & 0x3f ) << variableByteShift ) ; }
Converts a variable amount of bytes from the read buffer to a signed int.
<p/>
The first bit is for continuation info, the other six (last byte) or seven (all other bytes) bits are for data.
The second bit in the last byte indicates the sign of the number.

@return the int value.