Skip to content

Commit 370f91b

Browse files
[3.14] gh-134906: Document CompressionParameter.content_size_flag (GH-134907) (#134915)
gh-134906: Document CompressionParameter.content_size_flag (GH-134907) * Document CompressionParameter.content_size_flag (cherry picked from commit 5f60d0f) Co-authored-by: Emma Smith <emma@emmatyping.dev>
1 parent 4927596 commit 370f91b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Doc/library/compression.zstd.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,24 @@ Advanced parameter control
615615

616616
A value of zero causes the value to be selected automatically.
617617

618+
.. attribute:: content_size_flag
619+
620+
Write the size of the data to be compressed into the Zstandard frame
621+
header when known prior to compressing.
622+
623+
This flag only takes effect under the following two scenarios:
624+
625+
* Calling :func:`compress` for one-shot compression
626+
* Providing all of the data to be compressed in the frame in a single
627+
:meth:`ZstdCompressor.compress` call, with the
628+
:attr:`ZstdCompressor.FLUSH_FRAME` mode.
629+
630+
All other compression calls may not write the size information into the
631+
frame header.
632+
633+
``True`` or ``1`` enable the content size flag while ``False`` or ``0``
634+
disable it.
635+
618636
.. attribute:: checksum_flag
619637

620638
A four-byte checksum using XXHash64 of the uncompressed content is

0 commit comments

Comments
 (0)