(self, data)
| 660 | self.eof = False |
| 661 | |
| 662 | def decompress(self, data): |
| 663 | if self._decomp is None: |
| 664 | self._unconsumed += data |
| 665 | if len(self._unconsumed) <= 4: |
| 666 | return b'' |
| 667 | psize, = struct.unpack('<H', self._unconsumed[2:4]) |
| 668 | if len(self._unconsumed) <= 4 + psize: |
| 669 | return b'' |
| 670 | |
| 671 | self._decomp = lzma.LZMADecompressor(lzma.FORMAT_RAW, filters=[ |
| 672 | lzma._decode_filter_properties(lzma.FILTER_LZMA1, |
| 673 | self._unconsumed[4:4 + psize]) |
| 674 | ]) |
| 675 | data = self._unconsumed[4 + psize:] |
| 676 | del self._unconsumed |
| 677 | |
| 678 | result = self._decomp.decompress(data) |
| 679 | self.eof = self._decomp.eof |
| 680 | return result |
| 681 | |
| 682 | |
| 683 | compressor_names = { |
no test coverage detected