Skip to content

Commit 503cf3d

Browse files
committed
docs/uzlib: Update description of decompress() and mention DecompIO.
1 parent 6b8b56f commit 503cf3d

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

docs/library/uzlib.rst

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,33 @@
66

77
|see_cpython_module| :mod:`python:zlib`.
88

9-
This modules allows to decompress binary data compressed with DEFLATE
10-
algorithm (commonly used in zlib library and gzip archiver). Compression
9+
This module allows to decompress binary data compressed with
10+
`DEFLATE algorithm <https://en.wikipedia.org/wiki/DEFLATE>`_
11+
(commonly used in zlib library and gzip archiver). Compression
1112
is not yet implemented.
1213

1314
Functions
1415
---------
1516

16-
.. function:: decompress(data)
17+
.. function:: decompress(data, wbits=0, bufsize=0)
1718

18-
Return decompressed data as bytes.
19+
Return decompressed *data* as bytes. *wbits* is DEFLATE dictionary window
20+
size used during compression (8-15, the dictionary size is power of 2 of
21+
that value). Additionally, if value is positive, *data* is assumed to be
22+
zlib stream (with zlib header). Otherwise, if it's negative, it's assumed
23+
to be raw DEFLATE stream. *bufsize* parameter is for compatibility with
24+
CPython and is ignored.
25+
26+
.. class:: DecompIO(stream, wbits=0)
27+
28+
Create a stream wrapper which allows transparent decompression of
29+
compressed data in another *stream*. This allows to process compressed
30+
streams with data larger than available heap size. In addition to
31+
values described in :func:`decompress`, *wbits* may take values
32+
24..31 (16 + 8..15), meaning that input stream has gzip header.
33+
34+
.. admonition:: Difference to CPython
35+
:class: attention
36+
37+
This class is MicroPython extension. It's included on provisional
38+
basis and may be changed considerably or removed in later versions.

0 commit comments

Comments
 (0)