Lets say I'm making an HttpWebRequest for a gzip file out on a remote server. How do I stream that through SharpCompress so that I can write the content to disk (or to some other output stream)?
I tried a simple test like this:
I tried a simple test like this:
GZipStream gzs = new GZipStream(myHttpStream, CompressionMode.Decompress);
byte[] buffer = new byte[1024];
int read;
while ((read = gzs.Read(buffer, 0, buffer.Length)) > 0) {
myWriter.Write(buffer, 0, read);
}
myWriter.Flush();
gzs.Close();
It reads just the first row of the file and that's it. What am I doing wrong here? I'd really like to be able to stream it through this code without having to physically download the file first. Thanks