Пример #1
0
 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 = intVectorSerialzer.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 = VarStringSerializer.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
Пример #2
0
 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 = intVectorSerialzer.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 = VarStringSerializer.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
Пример #3
0
 def stream_serialize(self, f):
     VarStringSerializer.stream_serialize(self.vchMsg, f)
     VarStringSerializer.stream_serialize(self.vchSig, f)
Пример #4
0
 def stream_deserialize(cls, f):
     c = cls()
     c.vchMsg = VarStringSerializer.stream_deserialize(f)
     c.vchSig = VarStringSerializer.stream_deserialize(f)
     return c
Пример #5
0
 def stream_serialize(self, f):
     VarStringSerializer.stream_serialize(self.vchMsg, f)
     VarStringSerializer.stream_serialize(self.vchSig, f)
Пример #6
0
 def stream_deserialize(cls, f):
     c = cls()
     c.vchMsg = VarStringSerializer.stream_deserialize(f)
     c.vchSig = VarStringSerializer.stream_deserialize(f)
     return c