I am using the ZLIB.NET library and trying to decompress a file. I am using the sample code that they provided.
The input steam is my compressed zlib file and the output steam is the decompressed file. I am getting the file and it is decompressed fine, however my program just hangs on the last write. It looks like the write gets complete from viewing the file but I am not 100% sure about that. I've have set a breakpoint on output.Flush() and it never gets there.
Code:
public static void CopyStream(System.IO.Stream input, System.IO.Stream output)
{
byte[] buffer = new byte[2000];
int len;
while ((len = input.Read(buffer, 0, 2000)) > 0)
{
output.Write(buffer, 0, len); //it hangs here on the last write
}
output.Flush();
}
Comment