title: Write compressed data to NetworkStream
body: <p>I am writing a simple client-server application, and looking the MSDN docs, I came across some interesting stream types...</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream.aspx</a>
  <a href="http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx</a></p>
  
  <p>Apparently, there is such a thing as a <em>compressed</em> stream! Naturally, this is very attractive, considering we are dealing with networking. However, most unfortunately, TcpClient.GetStream() only returns a NetworkStream -- Not any form of compressed stream.</p>
  
  <p>I was wondering if it is possible to wire a compressed stream to redirect to the NetworkStream, meaning I could write the the compressed stream and that stream would write its compressed output to my NetworkStream. I'd also need to know how to do the reverse, get a compressed stream to read from a NetworkStream.</p>
  
  <p>On the side, which do you recommend I do -- Which offers the fastest compression, GZip or Deflate? And what is the difference in compression between the two?</p>