[
  {
    "Id": "452370",
    "ThreadId": "215161",
    "Html": "<p>I'm trying to use theDotNetZip library to decompress a .Z (UNIX compressed) file, but so far no joy.</p>\r\n<p>Here's my try-out code:</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:black;background-color:white\">\r\n<pre><span style=\"color:green\">// Get the stream of the source file.</span>\r\n<span style=\"color:blue\">using</span> (FileStream inFile = fiFileSrc.OpenRead())\r\n{\r\n    <span style=\"color:green\">// decompress file.</span>\r\n    <span style=\"color:blue\">using</span> (Ionic.Zlib.DeflateStream Decompress = <span style=\"color:blue\">new</span> Ionic.Zlib.DeflateStream(inFile, CompressionMode.Decompress))\r\n    {\r\n        <span style=\"color:blue\">int</span> i = Decompress.ReadByte();\r\n    }\r\n}\r\n</pre>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>With DeflateStream I'm getting:</p>\r\n<p>Ionic.Zlib.ZlibException: Bad state (invalid block type)</p>\r\n<p>And with ZLibStream I'm getting:</p>\r\n<p>Ionic.Zlib.ZlibException: Bad state (unknown compression method (0x1F))</p>\r\n<p>as exception on the line with the ReadByte call.</p>\r\n<p>I've checked and the first 2 bytes in the input file are 0x1F 0x9D which is the header for a compressed file.</p>\r\n<p>I'm using DotNetZip version 1.9.1.5</p>\r\n<p>&nbsp;</p>\r\n<p>What am I doing wrong?</p>",
    "PostedDate": "2010-06-07T03:14:03.793-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "653672",
    "ThreadId": "215161",
    "Html": "<p>I think that .Z files use the COMPRESS compression method, which is not supported by the ZlibStream.</p>\r\n<p>double-check the contents of that .Z file - is it a ZLIB-compressed stream, or a COMPRESS-compressed stream?&nbsp; IF the former, you should be able to uncompress with ZlibStream.&nbsp; If the latter, not.</p>",
    "PostedDate": "2011-08-06T07:13:19.16-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]