stream/stream.py
def _read_varint(self):
        """Read a varint from file, parse it, and return the decoded integer.
        """
        buff = self._fd.read(1)
        if buff == b'':
            return 0

        while (bytearray(buff)[-1] & 0x80) >> 7 == 1:  # while the MSB is 1
            new_byte = self._fd.read(1)
            if new_byte == b'':
                raise EOFError('unexpected EOF.')
            buff += new_byte

        varint, _ = decodeVarint(buff, 0)

        return varint
def _read_varint(self):
        """Read a varint from file, parse it, and return the decoded integer.
        """
        buff = self._fd.read(1)
        if buff == b'':
            return 0

        while (bytearray(buff)[-1] & 0x80) >> 7 == 1:  # while the MSB is 1
            new_byte = self._fd.read(1)
            if new_byte == b'':
                raise EOFError('unexpected EOF.')
            buff += new_byte

        varint, _ = decodeVarint(buff, 0)

        return varint
def _read_varint ( self ) : buff = self . _fd . read ( 1 ) if buff == b'' : return 0 while ( bytearray ( buff ) [ - 1 ] & 0x80 ) >> 7 == 1 : # while the MSB is 1 new_byte = self . _fd . read ( 1 ) if new_byte == b'' : raise EOFError ( 'unexpected EOF.' ) buff += new_byte varint , _ = decodeVarint ( buff , 0 ) return varint
Read a varint from file, parse it, and return the decoded integer.
Read a varint from file parse it and return the decoded integer .