O'Reilly logo

Visual Basic 2010 Unleashed by Alessandro Del Sole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compressing Data with Streams

One of the most interesting features of streams starting from .NET Framework 2.0 is the ability to compress and decompress data utilizing the GZipStream and DeflateStream objects. Both are exposed by the System.IO.Compression namespace, and basically they both compress data using the GZip algorithm. The only difference is that the GZipStream writes a small header to compressed data. The interesting thing is that they work similarly to other streams, and when you write or read data into the stream, data is automatically compressed or decompressed by the runtime. The good news is that you are not limited to compressing files, but any other kind of stream. Basically compressing and decompressing data is quite a simple ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required