MCPcopy
hub / github.com/legendary-gl/legendary / write

Method write

legendary/models/manifest.py:445–467  ·  view source on GitHub ↗
(self, bio)

Source from the content-addressed store, hash-verified

443 return _cdl
444
445 def write(self, bio):
446 cdl_start = bio.tell()
447 bio.write(struct.pack('<I', 0)) # placeholder size
448 bio.write(struct.pack('B', self.version))
449 bio.write(struct.pack('<I', len(self.elements)))
450
451 for chunk in self.elements:
452 bio.write(struct.pack('<IIII', *chunk.guid))
453 for chunk in self.elements:
454 bio.write(struct.pack('<Q', chunk.hash))
455 for chunk in self.elements:
456 bio.write(chunk.sha_hash)
457 for chunk in self.elements:
458 bio.write(struct.pack('B', chunk.group_num))
459 for chunk in self.elements:
460 bio.write(struct.pack('<I', chunk.window_size))
461 for chunk in self.elements:
462 bio.write(struct.pack('<q', chunk.file_size))
463
464 cdl_end = bio.tell()
465 bio.seek(cdl_start)
466 bio.write(struct.pack('<I', cdl_end - cdl_start))
467 bio.seek(cdl_end)
468
469
470class ChunkInfo:

Callers 5

write_fstringFunction · 0.45
writeMethod · 0.45
writeMethod · 0.45
writeMethod · 0.45
writeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected