def __init__(self): if Zstd is None: raise UnsupportedCompressionMethodError self._buf = BufferedRW() ctx = Zstd.ZstdCompressor() # type: ignore self._compressor = ctx.stream_writer(self._buf) self.flushed = False
def __init__(self, properties): if Zstd is None or len(properties) not in [ 3, 5 ] or (properties[0], properties[1], 0) > Zstd.ZSTD_VERSION: raise UnsupportedCompressionMethodError self._buf = BufferedRW() ctx = Zstd.ZstdDecompressor() # type: ignore self._decompressor = ctx.stream_writer(self._buf)
def __init__(self, properties: bytes, blocksize: Optional[int] = None): if not isinstance(properties, bytes): raise UnsupportedCompressionMethodError if len(properties) == 5: level, mem = struct.unpack("<BL", properties) elif len(properties) == 7: level, mem, _, _ = struct.unpack("<BLBB", properties) else: raise UnsupportedCompressionMethodError if blocksize: self.block_size = blocksize else: self.block_size = get_default_blocksize() self._buf = BufferedRW(self.block_size) self._buf = BufferedRW() self.decoder = None self.level = level self.mem = mem self.initialized = False
def __init__(self, properties: bytes): if Ppmd is None: raise UnsupportedCompressionMethodError if not isinstance(properties, bytes): raise UnsupportedCompressionMethodError if len(properties) == 5: level, mem = struct.unpack("<BL", properties) elif len(properties) == 7: level, mem, _, _ = struct.unpack("<BLBB", properties) else: raise UnsupportedCompressionMethodError self._buf = BufferedRW() self.decoder = None self.level = level self.mem = mem self.initialized = False
def __init__(self, level: int, mem: int): if Ppmd is None: raise UnsupportedCompressionMethodError self._buf = BufferedRW() self.encoder = Ppmd.Ppmd7Encoder(self._buf, level, mem) # type: ignore
def __init__(self, level: int, mem: int, blocksize: Optional[int] = None): self._buf = BufferedRW(blocksize) self.encoder = Ppmd.Ppmd7Encoder(self._buf, level, mem) # type: ignore
def __init__(self, level): self._buf = BufferedRW() ctx = zstandard.ZstdCompressor(level) # type: ignore self._compressor = ctx.stream_writer(self._buf) self.flushed = False