(self, read_context)
| 302 | write_context.write_buffer(swapped) |
| 303 | |
| 304 | def read(self, read_context): |
| 305 | byte_size = read_context.read_var_uint32() |
| 306 | data = read_context.read_bytes(byte_size) |
| 307 | if self.wrapper_type is BoolArray: |
| 308 | return BoolArray(bool(value) for value in data) |
| 309 | if self.reduced_precision: |
| 310 | if byte_size & 1: |
| 311 | raise ValueError(f"{self.wrapper_type.__name__} byte size mismatch") |
| 312 | raw = array.array("H") |
| 313 | raw.frombytes(data) |
| 314 | if not is_little_endian: |
| 315 | raw.byteswap() |
| 316 | return self.wrapper_type.from_buffer(raw.tobytes()) |
| 317 | raw = array.array(self.typecode) |
| 318 | raw.frombytes(data) |
| 319 | if not is_little_endian and raw.itemsize > 1: |
| 320 | raw.byteswap() |
| 321 | return self.wrapper_type(raw) |
| 322 | |
| 323 | |
| 324 | class BoolArraySerializer(_DenseArraySerializer): |
nothing calls this directly
no test coverage detected