{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "Hi,\n \nI have encountered an error during second call to Save(stream) method. Here is an example:\n \nZipFile\n zip = new\nZipFile();\n \n// add some files\nzip.AddDirectory(@\"C:\\temp\");\n \n// Save to first stream\nMemoryStream\n ms1 = new\nMemoryStream();\nzip.Save(ms1);\nms1.Close();\n \n// Try to save to another stream\nMemoryStream\n ms2 = new\nMemoryStream();\nzip.Save(ms2); // here exception\n is thrown\nms2.Close();\n \nThe exception is of ZipException type with \"Cannot read that as a ZipFile\" message and with inner exception of NullReferenceException type with \"Object reference not set to an instance of an object.\" message.\n \nGeneraly, I want to check zip size after adding each file. So I save zip to memory stream and check its length. This IMO is more elegant solution than saving to temporary files. Or perhaps, there is another way to check zip size?\n \nBest,\n \nJanusz",
    "LastUpdatedDate": "2013-02-21T18:43:03.43-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2011-09-02T07:42:10.39-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Saving zip to more than one stream throws exception",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 4,
    "Id": 14184
  },
  "FileAttachments": [],
  "Comments": [
    {
      "Message": "The same happens when you try to extract an ZipEntry after saving to the stream.\r\n\r\n//save ZipFile to stream\r\nzip.Save(stream)\r\n\r\n//read entry within the saved ZipFile\r\nusing (var mem = new MemoryStream())\r\n{\r\nzip[entryName].Extract(mem);\r\nbytes = mem.ToArray();\r\n}",
      "PostedDate": "2011-09-04T07:30:59.073-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-01-22T20:29:48.947-08:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-03-13T09:41:33.68-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2012-03-30T14:10:58.99-07:00",
      "Id": -2147483648
    },
    {
      "Message": "",
      "PostedDate": "2013-02-21T18:43:03.43-08:00",
      "Id": -2147483648
    }
  ]
}