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); }
Varying the compression level used on entries can affect the size-vs-speed tradeoff when compression and decompressing data streams or files.
As with some other properties on the ZipOutputStream class, like Password, and Encryption, setting this property on a ZipOutputStream instance will cause the specified CompressionLevel to be used on all ZipEntry items that are subsequently added to the ZipOutputStream instance.
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.