This article introduces the use of QuecPython's uzlib module and describes features of the latest version of the uzlib module.
The module uses the binary data compressed by DEFLATE Algorithm to decompress (generally used in the zlib library and the gzip archiver). This module realizes subsets of the corresponding CPython module. See CPython file zlib for more detailed information.
Note: 1. Compression has not been realized. 2. Before decompressing, the available space in the module should be checked to ensure that there is enough space to decompress.
uzlib.decompress
uzlib.decompress(data, wbits=0, bufsize=0)
Returns the compressed bytes object. wbits
is the window size of DEFLATE dictionary when decompressing. (8–15, the dictionary size is the power of 2 of wbits
value). If this value is positive, data
is assumed to be the zlib stream (with the zlib header). If the value is negative, data
is assumed to be the original DEFLATE stream. bufsize
is for compatibility with CPython and will be ignored.
uzlib.DecompIO
class uzlib.DecompIO(stream, wbits=0)
Creates a stream
decorator that allows data to be transparently compressed in another stream. This indicates the data can be greater than the compressive stream of available heap size. In addition to the values described above, wbits can have values 24.. 31 (16 + 8.. 15), which indicates that the input stream has the gzip header.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。