Deserialize bytes, returning an instance allow_padding - Allow buf to include extra padding. (default False) If allow_padding is False and not all bytes are consumed during deserialization DeserializationExtraDataError will be raised.
(cls, buf, allow_padding=False, params={})
| 92 | |
| 93 | @classmethod |
| 94 | def deserialize(cls, buf, allow_padding=False, params={}): |
| 95 | """Deserialize bytes, returning an instance |
| 96 | |
| 97 | allow_padding - Allow buf to include extra padding. (default False) |
| 98 | |
| 99 | If allow_padding is False and not all bytes are consumed during |
| 100 | deserialization DeserializationExtraDataError will be raised. |
| 101 | """ |
| 102 | fd = BytesIO(buf) |
| 103 | r = cls.stream_deserialize(fd, **params) |
| 104 | if not allow_padding: |
| 105 | padding = fd.read() |
| 106 | if len(padding) != 0: |
| 107 | raise DeserializationExtraDataError('Not all bytes consumed during deserialization', |
| 108 | r, padding) |
| 109 | return r |
| 110 | |
| 111 | def GetHash(self): |
| 112 | """Return the hash of the serialized object""" |
nothing calls this directly
no test coverage detected