@@ -16,7 +16,7 @@ earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_f
16
16
17
17
zlib's functions have many options and often need to be used in a particular
18
18
order. This documentation doesn't attempt to cover all of the permutations;
19
- consult the zlib manual at http ://www.zlib.net/manual.html for authoritative
19
+ consult the ` zlib manual < https ://www.zlib.net/manual.html>`_ for authoritative
20
20
information.
21
21
22
22
For reading and writing ``.gz `` files see the :mod: `gzip ` module.
@@ -312,6 +312,136 @@ Decompression objects support the following methods and attributes:
312
312
objects.
313
313
314
314
315
+ The following constants are available to configure compression and decompression
316
+ behavior:
317
+
318
+ .. data :: DEFLATED
319
+
320
+ The deflate compression method.
321
+
322
+
323
+ .. data :: MAX_WBITS
324
+
325
+ The maximum window size, expressed as a power of 2.
326
+ For example, if :const: `!MAX_WBITS ` is ``15 `` it results in a window size
327
+ of ``32 KiB ``.
328
+
329
+
330
+ .. data :: DEF_MEM_LEVEL
331
+
332
+ The default memory level for compression objects.
333
+
334
+
335
+ .. data :: DEF_BUF_SIZE
336
+
337
+ The default buffer size for decompression operations.
338
+
339
+
340
+ .. data :: Z_NO_COMPRESSION
341
+
342
+ Compression level ``0 ``.
343
+
344
+ .. versionadded :: 3.6
345
+
346
+
347
+ .. data :: Z_BEST_SPEED
348
+
349
+ Compression level ``1 ``.
350
+
351
+
352
+ .. data :: Z_BEST_COMPRESSION
353
+
354
+ Compression level ``9 ``.
355
+
356
+
357
+ .. data :: Z_DEFAULT_COMPRESSION
358
+
359
+ Default compression level (``-1 ``).
360
+
361
+
362
+ .. data :: Z_DEFAULT_STRATEGY
363
+
364
+ Default compression strategy, for normal data.
365
+
366
+
367
+ .. data :: Z_FILTERED
368
+
369
+ Compression strategy for data produced by a filter (or predictor).
370
+
371
+
372
+ .. data :: Z_HUFFMAN_ONLY
373
+
374
+ Compression strategy that forces Huffman coding only.
375
+
376
+
377
+ .. data :: Z_RLE
378
+
379
+ Compression strategy that limits match distances to one (run-length encoding).
380
+
381
+ This constant is only available if Python was compiled with zlib
382
+ 1.2.0.1 or greater.
383
+
384
+ .. versionadded :: 3.6
385
+
386
+
387
+ .. data :: Z_FIXED
388
+
389
+ Compression strategy that prevents the use of dynamic Huffman codes.
390
+
391
+ This constant is only available if Python was compiled with zlib
392
+ 1.2.2.2 or greater.
393
+
394
+ .. versionadded :: 3.6
395
+
396
+
397
+ .. data :: Z_NO_FLUSH
398
+
399
+ Flush mode ``0 ``. No special flushing behavior.
400
+
401
+ .. versionadded :: 3.6
402
+
403
+
404
+ .. data :: Z_PARTIAL_FLUSH
405
+
406
+ Flush mode ``1 ``. Flush as much output as possible.
407
+
408
+
409
+ .. data :: Z_SYNC_FLUSH
410
+
411
+ Flush mode ``2 ``. All output is flushed and the output is aligned to a byte boundary.
412
+
413
+
414
+ .. data :: Z_FULL_FLUSH
415
+
416
+ Flush mode ``3 ``. All output is flushed and the compression state is reset.
417
+
418
+
419
+ .. data :: Z_FINISH
420
+
421
+ Flush mode ``4 ``. All pending input is processed, no more input is expected.
422
+
423
+
424
+ .. data :: Z_BLOCK
425
+
426
+ Flush mode ``5 ``. A deflate block is completed and emitted.
427
+
428
+ This constant is only available if Python was compiled with zlib
429
+ 1.2.2.2 or greater.
430
+
431
+ .. versionadded :: 3.6
432
+
433
+
434
+ .. data :: Z_TREES
435
+
436
+ Flush mode ``6 ``, for inflate operations. Instructs inflate to return when
437
+ it gets to the next deflate block boundary.
438
+
439
+ This constant is only available if Python was compiled with zlib
440
+ 1.2.3.4 or greater.
441
+
442
+ .. versionadded :: 3.6
443
+
444
+
315
445
Information about the version of the zlib library in use is available through
316
446
the following constants:
317
447
@@ -347,10 +477,10 @@ the following constants:
347
477
Module :mod: `gzip `
348
478
Reading and writing :program: `gzip `\ -format files.
349
479
350
- http ://www.zlib.net
480
+ https ://www.zlib.net
351
481
The zlib library home page.
352
482
353
- http ://www.zlib.net/manual.html
483
+ https ://www.zlib.net/manual.html
354
484
The zlib manual explains the semantics and usage of the library's many
355
485
functions.
356
486
0 commit comments