ZlibCompressor

class ZlibCompressor(**properties: Any)

Superclasses: Object

Implemented Interfaces: Converter

GZlibCompressor is an implementation of Converter that compresses data using zlib.

Constructors

class ZlibCompressor
classmethod new(format: ZlibCompressorFormat, level: int) ZlibCompressor

Creates a new ZlibCompressor.

Added in version 2.24.

Parameters:
  • format – The format to use for the compressed data

  • level – compression level (0-9), -1 for default

Methods

class ZlibCompressor
get_file_info() FileInfo | None

Returns the ZlibCompressor:file-info property.

Added in version 2.26.

set_file_info(file_info: FileInfo | None = None) None

Sets file_info in compressor. If non-None, and compressor’s ZlibCompressor:format property is GZIP, it will be used to set the file name and modification time in the GZIP header of the compressed data.

Note: it is an error to call this function while a compression is in progress; it may only be called immediately after creation of compressor, or after resetting it with reset().

Added in version 2.26.

Parameters:

file_info – a FileInfo

Properties

class ZlibCompressor
props.file_info: FileInfo

If set to a non-None FileInfo object, and ZlibCompressor:format is GZIP, the compressor will write the file name and modification time from the file info to the GZIP header.

Added in version 2.26.

props.format: ZlibCompressorFormat

The format of the compressed data.

Added in version 2.24.

props.level: int

The level of compression from 0 (no compression) to 9 (most compression). -1 for the default level.

Added in version 2.24.