[
  {
    "Id": "579394",
    "ThreadId": "249407",
    "Html": "\r\n<p>I'm trying to write a stream directly from memory to a zip, but all of my files come out as 0-byte files in the resulting zip.</p>\r\n<p>&nbsp;</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre>                <span style=\"color:blue\">using</span> (ZipFile package = <span style=\"color:blue\">new</span> ZipFile(fullpath))\r\n                <span style=\"color:blue\">using</span> (MemoryStream stream = <span style=\"color:blue\">new</span> MemoryStream())\r\n                <span style=\"color:blue\">using</span> (BinaryWriter bin = <span style=\"color:blue\">new</span> BinaryWriter(stream))\r\n                {\r\n                    bin.Write(version);\r\n                    bin.Write(name);\r\n\r\n...\r\n\r\n                    <span style=\"color:blue\">if</span> (package.ContainsEntry(<span style=\"color:#a31515\">&quot;index&quot;</span>))\r\n                        package.UpdateEntry(<span style=\"color:#a31515\">&quot;index&quot;</span>, stream);\r\n                    <span style=\"color:blue\">else</span>\r\n                        package.AddEntry(<span style=\"color:#a31515\">&quot;index&quot;</span>, stream);\r\n\r\n                    package.Save();\r\n\r\n                }\r\n\r\n</pre>\r\n</div>\r\n<p>Anyone know what I'm doing wrong here?</p>\r\n<p>&nbsp;</p>\r\n",
    "PostedDate": "2011-03-12T00:54:30.287-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "579579",
    "ThreadId": "249407",
    "Html": "<p>Nevermind, I figured it out. I just needed to rewind the stream before trying to save it.</p>",
    "PostedDate": "2011-03-12T16:18:58.69-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]