ZLibCompressionOptions.CompressionLevel Property

Definition

Gets or sets the compression level for a compression stream.

C#
public int CompressionLevel { get; set; }

Property Value

The compression level for a compression stream. The default value is -1.

Exceptions

The value is less than -1 or greater than 9.

Remarks

Can accept any value between -1 and 9 (inclusive). 0 gives no compression, 1 gives best speed, 9 gives best compression,

and -1 requests the default compression level, which is equivalent to 6.

Applies to

Product Versions
.NET 9, 10