[
  {
    "Id": "175375",
    "ThreadId": "52212",
    "Html": "I'm attempting to use GZipStream to decompress a gzip file. &nbsp; I have version 1.8.2.7 of the library.&nbsp; Below is a snippet of the code I'm using.  Basically, the first time I read from the GZipStream, an Ionic.Zlib.ZlibException is thrown.  The exception itself has the message:  &quot;Can't handle this! AvailableBytesIn=8187&quot;.  Any ideas what may cause this?&nbsp;&nbsp; I introduced the use of the BufferedStream, thinking it may help with the problem, but no such luck.<br>\r\n<br>\r\nThanks\r\n<br>\r\nSteve\r\n<br>\r\n<br>\r\n<pre><code><br>\tstring outputFile;<br>\tstring inputFile;<br><br>\tFileInfo info = new FileInfo(inputFile);<br>\tbyte[] working = new byte[info.Length];<br>\tusing (Stream inputStream= new BufferedStream(File.OpenRead(inputFile), (int)info.Length))<br>\t{<br>\t\tusing (GZipStream decompressor = new GZipStream(inputStream, CompressionMode.Decompress))<br>\t\t{<br>\t\t\tint n = decompressor.Read(working, 0, working.Length);<br><br>\t\t\tif (File.Exists(outputFile))<br>\t\t\t\tFile.Delete(outputFile);<br><br>\t\t\tusing (Stream output = File.Create(outputFile))<br>\t\t\t{<br>\t\t\t\toutput.Write(working, 0, n);<br>\t\t\t\twhile (n != 0)<br>\t\t\t\t{<br>\t\t\t\t\tn = decompressor.Read(working, 0, working.Length);<br>\t\t\t\t\toutput.Write(working, 0, n);<br>\t\t\t\t}<br>\t\t\t}<br>\t\t}<br>\t}<br><br></code></pre>\r\n",
    "PostedDate": "2009-04-03T10:50:07.557-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]