Changeset 391 for python/trunk/Doc/library/zlib.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/zlib.rst
r2 r391 20 20 information. 21 21 22 For reading and writing ``.gz`` files see the :mod:`gzip` module. For 23 other archive formats, see the :mod:`bz2`, :mod:`zipfile`, and 24 :mod:`tarfile` modules. 22 For reading and writing ``.gz`` files see the :mod:`gzip` module. 25 23 26 24 The available exception and functions in this module are: … … 65 63 66 64 Compresses the data in *string*, returning a string contained compressed data. 67 *level* is an integer from `` 1`` to ``9`` controlling the level of compression;65 *level* is an integer from ``0`` to ``9`` controlling the level of compression; 68 66 ``1`` is fastest and produces the least compression, ``9`` is slowest and 69 produces the most. The default value is ``6``. Raises the :exc:`error`70 exception if any error occurs.71 72 73 .. function:: compressobj([level ])67 produces the most. ``0`` is no compression. The default value is ``6``. 68 Raises the :exc:`error` exception if any error occurs. 69 70 71 .. function:: compressobj([level[, method[, wbits[, memlevel[, strategy]]]]]) 74 72 75 73 Returns a compression object, to be used for compressing data streams that won't 76 fit into memory at once. *level* is an integer from `` 1`` to ``9`` controlling74 fit into memory at once. *level* is an integer from ``0`` to ``9`` controlling 77 75 the level of compression; ``1`` is fastest and produces the least compression, 78 ``9`` is slowest and produces the most. The default value is ``6``. 76 ``9`` is slowest and produces the most. ``0`` is no compression. The default 77 value is ``6``. 78 79 *method* is the compression algorithm. Currently, the only supported value is 80 ``DEFLATED``. 81 82 *wbits* is the base two logarithm of the size of the window buffer. This 83 should be an integer from ``8`` to ``15``. Higher values give better 84 compression, but use more memory. The default is 15. 85 86 *memlevel* controls the amount of memory used for internal compression state. 87 Valid values range from ``1`` to ``9``. Higher values using more memory, 88 but are faster and produce smaller output. The default is 8. 89 90 *strategy* is used to tune the compression algorithm. Possible values are 91 ``Z_DEFAULT_STRATEGY``, ``Z_FILTERED``, and ``Z_HUFFMAN_ONLY``. The default 92 is ``Z_DEFAULT_STRATEGY``. 79 93 80 94 … … 116 130 Decompresses the data in *string*, returning a string containing the 117 131 uncompressed data. The *wbits* parameter controls the size of the window 118 buffer. If *bufsize* is given, it is used as the initial size of the output 132 buffer, and is discussed further below. 133 If *bufsize* is given, it is used as the initial size of the output 119 134 buffer. Raises the :exc:`error` exception if any error occurs. 120 135 … … 123 138 value should be between 8 and 15 for the most recent versions of the zlib 124 139 library, larger values resulting in better compression at the expense of greater 125 memory usage. The default value is 15. When *wbits* is negative, the standard 126 :program:`gzip` header is suppressed; this is an undocumented feature of the 127 zlib library, used for compatibility with :program:`unzip`'s compression file 128 format. 140 memory usage. When decompressing a stream, *wbits* must not be smaller 141 than the size originally used to compress the stream; using a too-small 142 value will result in an exception. The default value is therefore the 143 highest value, 15. When *wbits* is negative, the standard 144 :program:`gzip` header is suppressed. 129 145 130 146 *bufsize* is the initial size of the buffer used to hold decompressed data. If 131 147 more space is required, the buffer size will be increased as needed, so you 132 148 don't have to get this value exactly right; tuning it will only save a few calls 133 to :c func:`malloc`. The default size is 16384.149 to :c:func:`malloc`. The default size is 16384. 134 150 135 151
Note:
See TracChangeset
for help on using the changeset viewer.