(self, binary: bytes)
| 37 | return buffer.to_bytes(0, buffer.get_writer_index()) |
| 38 | |
| 39 | def decode(self, binary: bytes): |
| 40 | buf = pyfory.Buffer(binary, 0, len(binary)) |
| 41 | peer_hash = buf.read_int64() |
| 42 | assert self.schema_hash == peer_hash, ( |
| 43 | f"Schema is not consistent, encoder schema is {self.schema}, " |
| 44 | f"clz is {self.clz}. Self/peer schema hash is " |
| 45 | f"{self.schema_hash, peer_hash}. " |
| 46 | f"Please check writer schema." |
| 47 | ) |
| 48 | buf = pyfory.Buffer(binary, 8, len(binary) - 8) |
| 49 | row = pyfory.RowData(self.schema, buf) |
| 50 | return self.row_encoder.from_row(row) |
| 51 | |
| 52 | def to_row(self, obj): |
| 53 | return self.row_encoder.to_row(obj) |
nothing calls this directly
no test coverage detected