(fo: tp.IO[bytes])
| 41 | |
| 42 | |
| 43 | def read_ecdc_header(fo: tp.IO[bytes]): |
| 44 | header_bytes = _read_exactly(fo, _encodec_header_struct.size) |
| 45 | magic, version, meta_size = _encodec_header_struct.unpack(header_bytes) |
| 46 | if magic != _ENCODEC_MAGIC: |
| 47 | raise ValueError("File is not in ECDC format.") |
| 48 | if version != 0: |
| 49 | raise ValueError("Version not supported.") |
| 50 | meta_bytes = _read_exactly(fo, meta_size) |
| 51 | return json.loads(meta_bytes.decode('utf-8')) |
| 52 | |
| 53 | |
| 54 | class BitPacker: |
nothing calls this directly
no test coverage detected