MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / LZMACompressor

Class LZMACompressor

tools/python-3.11.9-amd64/Lib/zipfile.py:632–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630
631
632class LZMACompressor:
633
634 def __init__(self):
635 self._comp = None
636
637 def _init(self):
638 props = lzma._encode_filter_properties({'id': lzma.FILTER_LZMA1})
639 self._comp = lzma.LZMACompressor(lzma.FORMAT_RAW, filters=[
640 lzma._decode_filter_properties(lzma.FILTER_LZMA1, props)
641 ])
642 return struct.pack('<BBH', 9, 4, len(props)) + props
643
644 def compress(self, data):
645 if self._comp is None:
646 return self._init() + self._comp.compress(data)
647 return self._comp.compress(data)
648
649 def flush(self):
650 if self._comp is None:
651 return self._init() + self._comp.flush()
652 return self._comp.flush()
653
654
655class LZMADecompressor:

Callers 3

__init__Method · 0.85
compressFunction · 0.85
_get_compressorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected