CompressionMode Enumeration


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Specifies whether to compress or decompress the underlying stream.

Namespace:   System.IO.Compression
Assembly:  System (in System.dll)

type CompressionMode

Member nameDescription

Compresses the underlying stream.


Decompresses the underlying stream.

This enumeration is used with the GZipStream and DeflateStream classes.

The following code example uses the CompressionMode enumeration with the GZipStream class to compress and decompress a file.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top