[
  {
    "Id": "419676",
    "ThreadId": "205358",
    "Html": "<p>ZipFile.Read(byte[] buffer) and ZipFile.Read(Stream zipStream) (if zipStream supports seeking) throw System.IO.IOException when zip file content has small amount of data but not empty. In large amount of data and empty data cases they throw Ionic.Zip.BadReadException.</p>\r\n<p>There are some unit tests.</p>\r\n<p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre><span style=\"color:Green\">// this test fails</span>\r\n[TestMethod]\r\n[ExpectedException(<span style=\"color:Blue\">typeof</span>(BadReadException))]\r\n<span style=\"color:Blue\">public</span> <span style=\"color:Blue\">void</span> IncorrectZipContentTest1()\r\n{\r\n    <span style=\"color:Blue\">byte</span>[] incorrectZipContent = Encoding.UTF8.GetBytes(<span style=\"color:#A31515\">&quot;wrong zipfile content&quot;</span>);\r\n    ZipFile zipFile = ZipFile.Read(incorrectZipContent);\r\n}\r\n\r\n<span style=\"color:Green\">// this test succeeds</span>\r\n[TestMethod]\r\n[ExpectedException(<span style=\"color:Blue\">typeof</span>(BadReadException))]\r\n<span style=\"color:Blue\">public</span> <span style=\"color:Blue\">void</span> IncorrectZipContentTest2()\r\n{\r\n    ZipFile zipFile = ZipFile.Read(<span style=\"color:Blue\">new</span> <span style=\"color:Blue\">byte</span>[0]);\r\n}\r\n\r\n<span style=\"color:Green\">// this test succeeds too</span>\r\n[TestMethod]\r\n[ExpectedException(<span style=\"color:Blue\">typeof</span>(BadReadException))]\r\n<span style=\"color:Blue\">public</span> <span style=\"color:Blue\">void</span> IncorrectZipContentTest3()\r\n{\r\n    <span style=\"color:Blue\">byte</span>[] incorrectZipContent = <span style=\"color:Blue\">new</span> <span style=\"color:Blue\">byte</span>[8192];\r\n    ZipFile zipFile = ZipFile.Read(incorrectZipContent);\r\n}\r\n</pre>\r\n</div>\r\n</p>\r\n<p>I think, first code snippet should throw Ionic.Zip.BadReadException too.</p>",
    "PostedDate": "2010-03-18T04:47:59.237-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "419693",
    "ThreadId": "205358",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=10459\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2010-03-18T05:24:13.863-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]