Decode the buffer. Decoding is partially implemented
(self)
| 146 | return dict(zip(keys, values)) |
| 147 | |
| 148 | def decode(self): |
| 149 | """Decode the buffer. Decoding is partially implemented""" |
| 150 | root_end = len(self.buffer) - 1 |
| 151 | root_byte_width = self.buffer[root_end] |
| 152 | root_end -= 1 |
| 153 | root_packed_type = self.buffer[root_end] |
| 154 | root_end -= root_byte_width |
| 155 | |
| 156 | root_type = FlexBufferType(root_packed_type >> 2) |
| 157 | byte_width = 1 << BitWidth(root_packed_type & 3) |
| 158 | |
| 159 | if root_type == FlexBufferType.FBT_MAP: |
| 160 | return self.decode_map(root_end, byte_width, root_byte_width) |
| 161 | raise NotImplementedError("Flexbuffer Decoding is partially imlpemented.") |
no test coverage detected