[
  {
    "Id": "545370",
    "ThreadId": "240837",
    "Html": "\r\n<p>First off, thanks for the brilliant library and all the effort that has gone into it.</p>\r\n<p>I've found that when I write data to a ZipOutputStream the data buffer is corrupted afterwords. I've looked through the documentation, but didn't find a warning indicating that such a side-effect is intended. Is this due to the encryption I'm enabling?</p>\r\n<p>Here is a little example which reproduces the problem. If I use ZipFile instead of ZipOutputStream the buffer doesn't get corrupted.</p>\r\n<p></p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">var</span> content = <span style=\"color:blue\">new</span> <span style=\"color:blue\">byte</span>[1789];\r\n<span style=\"color:blue\">unchecked</span>\r\n{\r\n    <span style=\"color:blue\">byte</span> b = 0;\r\n    <span style=\"color:blue\">for</span> (<span style=\"color:blue\">var</span> i = 0; i &lt; content.Length; i&#43;&#43;, b&#43;&#43;)\r\n    {\r\n        content[i] = b;\r\n    }\r\n}\r\n\r\n<span style=\"color:blue\">using</span> (<span style=\"color:blue\">var</span> fileStream = File.OpenWrite(<span style=\"color:#a31515\">&quot;temp.zip&quot;</span>))\r\n{\r\n    <span style=\"color:blue\">using</span>(<span style=\"color:blue\">var</span> zipStream = <span style=\"color:blue\">new</span> ZipOutputStream(fileStream, <span style=\"color:blue\">true</span>))\r\n    {\r\n        zipStream.CompressionLevel = CompressionLevel.None;\r\n        zipStream.Password = <span style=\"color:#a31515\">&quot;mydummypassword&quot;</span>;\r\n        zipStream.Encryption = EncryptionAlgorithm.WinZipAes256;\r\n        zipStream.PutNextEntry(<span style=\"color:#a31515\">&quot;myentry.myext&quot;</span>);\r\n        zipStream.Write(content, 0, content.Length);\r\n    }\r\n}\r\n\r\n<span style=\"color:blue\">unchecked</span>\r\n{\r\n    <span style=\"color:blue\">byte</span> b = 0;\r\n    <span style=\"color:blue\">for</span> (<span style=\"color:blue\">var</span> i = 0; i &lt; content.Length; i&#43;&#43;, b&#43;&#43;)\r\n    {\r\n        <span style=\"color:blue\">if</span> (content[i] != b)\r\n        {\r\n            Console.WriteLine(<span style=\"color:#a31515\">&quot;Buffer was modified.&quot;</span>);\r\n        }\r\n    }\r\n}\r\n</pre>\r\n</div>\r\n<p></p>\r\n",
    "PostedDate": "2011-01-07T06:18:21.29-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "547699",
    "ThreadId": "240837",
    "Html": "\r\n<p>That is unexpected; it seems like a bug in DotNetZip.</p>\r\n",
    "PostedDate": "2011-01-11T18:31:35.387-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "547700",
    "ThreadId": "240837",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/workitem/12815\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2011-01-11T18:32:33.247-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "547784",
    "ThreadId": "240837",
    "Html": "\r\n<p>Thanks, I'm using WriteByte(byte) in the meantime, but I expect that Write(byte[], int, int) will perform faster.</p>\r\n",
    "PostedDate": "2011-01-11T23:11:24.093-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]