Function
write_ecdc_header
(fo: tp.IO[bytes], metadata: tp.Any)
Source from the content-addressed store, hash-verified
| 19 | |
| 20 | |
| 21 | def write_ecdc_header(fo: tp.IO[bytes], metadata: tp.Any): |
| 22 | meta_dumped = json.dumps(metadata).encode('utf-8') |
| 23 | version = 0 |
| 24 | header = _encodec_header_struct.pack(_ENCODEC_MAGIC, version, |
| 25 | len(meta_dumped)) |
| 26 | fo.write(header) |
| 27 | fo.write(meta_dumped) |
| 28 | fo.flush() |
| 29 | |
| 30 | |
| 31 | def _read_exactly(fo: tp.IO[bytes], size: int) -> bytes: |
Callers
nothing calls this directly
Tested by
no test coverage detected