For my application, I need to upload a zipped tif image. The caveat is that the tif is downloaded from a webservice to a MemoryStream and I’m trying to avoid writing to the harddrive. What’s the best way to zip this MemoryStream and copy the resulting data to another stream (Specifically, a HttpWebRequest‘s request stream) without saving any files to disk?
Zipping in place would also be ideal… These tif images are usually 200+ MB and I’d rather not have the image and it’s zip in memory at the same time if at all avoidable. If unavoidable, I may be able to just deal with it.
Have you taken a look at the GZipStream? This should be able to deal with most of your problems.
See: http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx