def write_varint(value: types.uint, io: IO): """ Write unsigned `VarInt` to a file-like object. """ while value > 0x7F: io.write(bytes((value & 0x7F | 0x80, ))) value >>= 7 io.write(bytes((value, )))
def dump(self, value: Any, io: IO): unsigned_varint_serializer.dump(len(value), io) io.write(value)
def dump(self, value: Any, io: IO): io.write(pack('<d', value))
def dump(self, value: Any, io: IO): io.write(b'\x01' if value else b'\x00')