Xceed .NET Libraries Documentation
Streaming compression
Welcome to Xceed .NET, .NET Standard and Xamarin Libraries! > Basic Concepts > Zip and streaming capabilities > Streaming compression

In situations where it is necessary to compress and decompress raw data, the classes in the Xceed.Compression.Formats namespace and the Xceed.Compression namespace can be used to perform streaming compression around any kind of %System.IO.Stream% to compress data.

Differences between streaming compression and zipping

Streaming compression is the act of compressing and decompressing raw data from a stream or memory buffer.

Zipping combines streaming compression with archiving. Archiving means combining several different files or folders into a single archive file and storing meta data about each item in the archive using a structured format. As such, Zip is considered a archiver and a compressor.

It is possible to perform a sort of Streaming Zip, where a zip file can be created or extracted sequentially without seeking in the archive file. Please see the Xceed Real-Time Zip for .NET component if your scenario doesn't allow for seeking but still requires a zip file.

How streaming compression works 

The Xceed.Compression.Formats namespace defines classes like GZipCompressedStreamXceedCompressedStream and ZLibCompressedStream which can be constructed around any kind of .NET Stream to compress data that is written to the stream and decompress data that is read from the stream. The classes also contain static Compress and Decompress methods that allow easy compression and decompression of byte arrays.

The following diagram represents the relationship between compressed stream classes and the %System.IO.Stream% classes: 

See Also

Compression