def deserialize(stream): pid_len, stream = unpack_stream(stream) pid = stream.read(pid_len).decode() pcls = PacketMeta.REGISTRY.get_obj(pid) fields = [] for field in pcls._fields: f, stream = pcls.__dict__[field]._deserialize(stream) fields.append(f) return pcls(*fields)
def _deserialize(self, stream): length, stream = unpack_stream(stream) data = stream.read(length) return self._ld_deserialize(data), stream
def _deserialize(self, stream): return unpack_stream(stream)