[
  {
    "Id": "639074",
    "ThreadId": "264326",
    "Html": "<p>I receive from server compressed deflate bytes, when i want to decompress my byte array i receive the Exception. This is compress text and it can have a <span id=\"result_box\" lang=\"en\"><span title=\"Kliknij, aby wyświetlić alternatywne tłumaczenia\">non-</span><span title=\"Kliknij, aby wyświetlić alternatywne tłumaczenia\">ansi</span></span> character.</p>\n<p>$exception&nbsp;&nbsp;&nbsp; {Ionic.Zlib.ZlibException: Bad state (invalid stored block lengths)<br /> &nbsp;&nbsp; at Ionic.Zlib.InflateManager.Inflate(FlushType flush) in c:\\DotNetZip\\v1.9.1.5\\DotNetZip\\Zlib\\Inflate.cs:line 1690<br /> &nbsp;&nbsp; at Ionic.Zlib.ZlibCodec.Inflate(FlushType flush) in c:\\DotNetZip\\v1.9.1.5\\DotNetZip\\Zlib\\ZlibCodec.cs:line 358<br /> &nbsp;&nbsp; at Ionic.Zlib.ZlibBaseStream.Read(Byte[] buffer, Int32 offset, Int32 count) in c:\\DotNetZip\\v1.9.1.5\\DotNetZip\\Zlib\\ZlibBaseStream.cs:line 477<br /> &nbsp;&nbsp; at Ionic.Zlib.DeflateStream.Read(Byte[] buffer, Int32 offset, Int32 count) in c:\\DotNetZip\\v1.9.1.5\\DotNetZip\\Zlib\\DeflateStream.cs:line 534<br /> &nbsp;&nbsp; at Ionic.Zlib.ZlibBaseStream.UncompressBuffer(Byte[] compressed, Stream decompressor) in c:\\DotNetZip\\v1.9.1.5\\DotNetZip\\Zlib\\ZlibBaseStream.cs:line 615<br /> &nbsp;&nbsp; at Ionic.Zlib.DeflateStream.UncompressBuffer(Byte[] compressed) in c:\\DotNetZip\\v1.9.1.5\\DotNetZip\\Zlib\\DeflateStream.cs:line 698<br /> &nbsp;&nbsp; at Gadulec.Net.PacketTask.FriedRecive() in C:\\Users\\Johniak\\Documents\\Visual Studio 2010\\Projects\\Gadulec. Net\\Gadulec. Net\\Packet.cs:line 316}&nbsp;&nbsp;&nbsp; System.Exception {Ionic.Zlib.ZlibException}</p>\n<p>&nbsp;</p>\n<p>\n<div style=\"color: black; background-color: white;\">\n<pre>                reply = <span style=\"color: blue;\">new</span> <span style=\"color: blue;\">byte</span>[size - 7];\n                <span style=\"color: blue;\">for</span> (<span style=\"color: blue;\">int</span> i = 0; i &lt; (size - 7); i++)\n                {\n                    reply[i] = Receiver.ReadByte();\n                }\n                <span style=\"color: blue;\">var</span> buffer = Ionic.Zlib.DeflateStream.UncompressBuffer(reply);\n</pre>\n</div>\n</p>\n<p>Sory for my English</p>",
    "PostedDate": "2011-07-07T14:45:51.333-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "641247",
    "ThreadId": "264326",
    "Html": "<p>1st - try v1.9.1.6000 of DotNetZip. See if the problem still occurs there.</p>\r\n<p>2nd - If not, then.... Do you know what the original uncompressed data is?&nbsp;&nbsp; Do you know how it was compressed, using what tool or library?&nbsp;&nbsp; Which is it?</p>\r\n<p>Can you produce a test case that reliably reproduces this problem? can you provide code to me me that generates compressed data, then tries decompressing in the way you describe, using DotNetZip, and causes the exception you see?</p>\r\n<p>It's possible to see the error you're describing when decompressing data that is not a valid compressed stream, or not a valid DEFLATE stream.&nbsp; For example if you compress with ZLIB then try decompressing with DeflateStream, you may see this problem.&nbsp; Or vice versa. So please verify that the data you are decompressing is actually a DEFLATE stream.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-07-12T11:45:32.17-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]