CompressionRatio Property

DotNetZip

Ionic Zip Library v1.9.1.6 CompressionRatio Property
ReferenceIonic.ZipZipEntryCompressionRatio
The ratio of compressed size to uncompressed size of the ZipEntry.
Declaration Syntax
C# Visual Basic Visual C++
public double CompressionRatio { get; }
Public ReadOnly Property CompressionRatio As Double
	Get
public:
property double CompressionRatio {
	double get ();
}
Remarks

This is a ratio of the compressed size to the uncompressed size of the entry, expressed as a double in the range of 0 to 100+. A value of 100 indicates no compression at all. It could be higher than 100 when the compression algorithm actually inflates the data, as may occur for small files, or uncompressible data that is encrypted.

You could format it for presentation to a user via a format string of "{3,5:F0}%" to see it as a percentage.

If the size of the original uncompressed file is 0, implying a denominator of 0, the return value will be zero.

This property is valid after reading in an existing zip file, or after saving the ZipFile that contains the ZipEntry. You cannot know the effect of a compression transform until you try it.

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