{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "When I call UpdateEntry(string,Stream) and then Save(), the resulting Zip-File is corrupted.\nWhen I try to extract the updated Zip file, there is an error message. Also the Size of the updated file in the zipfile remains at its old value",
    "LastUpdatedDate": "2015-07-29T17:07:44.87-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2010-09-07T00:10:20.87-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "UpdateEntry will result in a corrupt Zip File where the updated file can't be read",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 4,
    "Id": 11880
  },
  "FileAttachments": [
    {
      "FileId": 4147,
      "FileName": "UpdateProblem.zip",
      "DownloadUrl": ".\\4147"
    }
  ],
  "Comments": [
    {
      "Message": "I will need example code that demonstrates the problem.  I have test cases in the test tree that call Update repeatedly, and I have not yet seen any problems like this.  So your case must be unique.  Please provide the code that shows the problem.  ",
      "PostedDate": "2011-06-17T22:07:12.27-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2011-10-13T23:16:40.657-07:00",
      "Id": -2147483648
    },
    {
      "Message": "The following code sample throws an exception after updating and extracting of an existing zip entry.\r\n\r\nusing System.IO;\r\nusing Ionic.Zip;\r\n\r\nnamespace UpdateProblem\r\n{\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            string fileName = Path.Combine(Path.GetTempPath(), \"Test.zip\");\r\n            if (File.Exists(fileName)) File.Delete(fileName);\r\n            using (var zipFile = new ZipFile(fileName))\r\n            {\r\n                zipFile.AddEntry(\"File.txt\", \"Hello World!\");\r\n                zipFile.Save();\r\n                ZipEntry entry = zipFile.UpdateEntry(\"File.txt\", \"The quick brown fox jumps over the lazy dog.\");\r\n                zipFile.Save();\r\n                using (var stream = new MemoryStream())\r\n                {\r\n                    // ZlibException: Message=Bad state (invalid stored block lengths)\r\n                    entry.Extract(stream);\r\n                }\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nI have attached the Visual Studio solution of the code sample to this issue.\r\n\r\nKind regards\r\n\r\nRalf Aron",
      "PostedDate": "2011-10-13T23:16:44.11-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-02-22T10:53:22.643-08:00",
      "Id": -2147483648
    },
    {
      "Message": "Same problem. UpdateEntry (or DeleteEntry followed of AddEntry) is very instable and corrupt reguraly the zip file.\r\nIn this state, DotNetZip is no usable. Do you think to fix this bug (last version has more than 1,5 year) ?",
      "PostedDate": "2012-02-22T10:55:38.887-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-02-23T06:46:20.32-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-02-23T11:38:50.933-08:00",
      "Id": -2147483648
    },
    {
      "Message": "I'm also having problems with UpdateEntry. The first UpdateEntry to a ZIP file works fine (unlike in raron's example - haven't actually tried his code), but the second one results in a corrupt file.\r\n\r\n(If it matters, the ZIP gets saved immediately after each UpdateEntry call.)",
      "PostedDate": "2012-04-14T21:27:41.247-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:26.997-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2015-07-29T17:07:44.87-07:00",
      "Id": -2147483648
    }
  ]
}