CompressionLevel Property

DotNetZip

Ionic Zip Library v1.9.1.6 CompressionLevel Property
ReferenceIonic.ZipZipEntryCompressionLevel
Sets the compression level to be used for the entry when saving the zip archive. This applies only for CompressionMethod = DEFLATE.
Declaration Syntax
C# Visual Basic Visual C++
public CompressionLevel CompressionLevel { get; set; }
Public Property CompressionLevel As CompressionLevel
	Get
	Set
public:
property CompressionLevel CompressionLevel {
	CompressionLevel get ();
	void set (CompressionLevel value);
}
Remarks

When using the DEFLATE compression method, Varying the compression level used on entries can affect the size-vs-speed tradeoff when compression and decompressing data streams or files.

If you do not set this property, the default compression level is used, which normally gives a good balance of compression efficiency and compression speed. In some tests, using BestCompression can double the time it takes to compress, while delivering just a small increase in compression efficiency. This behavior will vary with the type of data you compress. If you are in doubt, just leave this setting alone, and accept the default.

When setting this property on a ZipEntry that is read from an existing zip file, calling ZipFile.Save() will cause the new CompressionLevel to be used on the entry in the newly saved zip file.

Setting this property may have the side effect of modifying the CompressionMethod property. If you set the CompressionLevel to a value other than None, CompressionMethod will be set to Deflate, if it was previously None.

Setting this property has no effect if the CompressionMethod is something other than Deflate or None.

Assembly: Ionic.Zip (Module: Ionic.Zip) Version: 1.9.1.8 (1.9.1.8)