I\'m implementing Deflate and GZip compression for web content. The .NET Framework DeflateStream performs very well (it doesn\'t compress that good as SharpZipLib, but it is
Another approach is to flush the deflater stream (and possibly also close it), to guarantee that all buffered compressed data is written to the output stream, and then simply write your precompressed data to the underlying output stream, then re-open the deflater stream on top of your output stream again.