def stream_serialize(self, f): f.write(struct.pack(b"<i", self.nVersion)) f.write(struct.pack(b"<q", self.nRelayUntil)) f.write(struct.pack(b"<q", self.nExpiration)) f.write(struct.pack(b"<i", self.nID)) f.write(struct.pack(b"<i", self.nCancel)) f.write(intVectorSerializer.serialize(self.setCancel)) f.write(struct.pack(b"<i", self.nMinVer)) f.write(struct.pack(b"<i", self.nMaxVer)) f.write(intVectorSerializer.serialize(self.setSubVer)) f.write(struct.pack(b"<i", self.nPriority)) f.write(VarStringSerializer.serialize(self.strComment)) f.write(VarStringSerializer.serialize(self.strStatusBar)) f.write(VarStringSerializer.serialize(self.strReserved))
def stream_deserialize(cls, f): c = cls() c.nVersion = struct.unpack(b"<i", ser_read(f, 4))[0] c.nRelayUntil = struct.unpack(b"<q", ser_read(f, 8))[0] c.nExpiration = struct.unpack(b"<q", ser_read(f, 8))[0] c.nID = struct.unpack(b"<i", ser_read(f, 4))[0] c.nCancel = struct.unpack(b"<i", ser_read(f, 4))[0] c.setCancel = intVectorSerializer.deserialize(f) c.nMinVer = struct.unpack(b"<i", ser_read(f, 4))[0] c.nMaxVer = struct.unpack(b"<i", ser_read(f, 4))[0] c.setSubVer = intVectorSerializer.deserialize(f) c.nPriority = struct.unpack(b"<i", ser_read(f, 4))[0] c.strComment = VarStringSerializer.deserialize(f) c.strStatusBar = VarStringSerializer.deserialize(f) c.strReserved = VarStringSerializer.deserialize(f) return c
def stream_deserialize(cls, f): c = cls() c.nVersion = struct.unpack(b"<i", ser_read(f,4))[0] c.nRelayUntil = struct.unpack(b"<q", ser_read(f,8))[0] c.nExpiration = struct.unpack(b"<q", ser_read(f,8))[0] c.nID = struct.unpack(b"<i", ser_read(f,4))[0] c.nCancel = struct.unpack(b"<i", ser_read(f,4))[0] c.setCancel = intVectorSerializer.deserialize(f) c.nMinVer = struct.unpack(b"<i", ser_read(f,4))[0] c.nMaxVer = struct.unpack(b"<i", ser_read(f,4))[0] c.setSubVer = intVectorSerializer.deserialize(f) c.nPriority = struct.unpack(b"<i", ser_read(f,4))[0] c.strComment = VarStringSerializer.deserialize(f) c.strStatusBar = VarStringSerializer.deserialize(f) c.strReserved = VarStringSerializer.deserialize(f) return c
def stream_serialize(self, f): VarStringSerializer.stream_serialize(self.vchMsg, f) VarStringSerializer.stream_serialize(self.vchSig, f)
def stream_deserialize(cls, f): c = cls() c.vchMsg = VarStringSerializer.stream_deserialize(f) c.vchSig = VarStringSerializer.stream_deserialize(f) return c