def read_varint(io: IO) -> types.uint: """ Read unsigned `VarInt` from a file-like object. """ value = 0 for shift in count(0, 7): byte, = io.read(1) value |= (byte & 0x7F) << shift if not byte & 0x80: return value
def skip_bytes(io: IO): io.read(unsigned_varint_serializer.load(io))
def skip_fixed_64(io: IO): io.read(8)
def skip_fixed_32(io: IO): io.read(4)
def skip_varint(io: IO): while io.read(1)[0] & 0x80: pass
def load(self, io: IO) -> Any: return unpack('<d', io.read(8))[0]
def load(self, io: IO) -> Any: return unpack('<f', io.read(4))[0]
def load(self, io: IO) -> Any: length = unsigned_varint_serializer.load(io) return io.read(length)