[
  {
    "Id": "216321",
    "ThreadId": "63612",
    "Html": "<p>Hello!</p>\r\n<p>Can I create a&nbsp;zip entry, get the underlying stream, and write to that stream myself? I specifically don't want to have the library &quot;grab from the stream&quot; as described in the FAQ,&nbsp;as it would force me to create an intermediate stream just for that purpose, which is impractical at best. I need to be able to write to the compressed stream incrementally as data gets generated, then flush the stream when I'm done. Is that possible?</p>\r\n<p>Thanks, Axel</p>",
    "PostedDate": "2009-07-27T03:33:49.67-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216391",
    "ThreadId": "63612",
    "Html": "<p>You can't do what you want with the library, as it is today.</p>\r\n<p>You could use a Pipelined stream, as described in <a href=\"http://msdn.microsoft.com/en-us/magazine/cc163290.aspx\">this article</a>.&nbsp; It would require multiple threads.</p>\r\n<p>Thread 1:</p>\r\n<pre>  bs = new BlockingStream();\r\n  while (!done)\r\n  {\r\n    bs.Write(...);\r\n  }\r\n  bs.SetEndOfStream();\r\n</pre>\r\n<p>Thread 2:</p>\r\n<pre>  using (var zip = new ZipFile())\r\n  {\r\n    zip.AddEntry(&quot;entryname.txt&quot;, &quot;&quot;, bs);\r\n    zip.Save();\r\n  }\r\n</pre>\r\n<p>I think that should work. And yes, I realize it involves an intermediate stream, which I know is invconvenient. But it provides your desired model.</p>",
    "PostedDate": "2009-07-27T07:55:12.433-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216530",
    "ThreadId": "63612",
    "Html": "<p>Thank you very much for your reply and the suggestion. Do you have any plan to add&nbsp;such streaming abilities&nbsp;in the future?</p>",
    "PostedDate": "2009-07-27T13:33:15.363-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "216533",
    "ThreadId": "63612",
    "Html": "<p>I was thinking about how to implement what you asked for, without requiring an external stream to pipeline the information.</p>\r\n<p>So far I haven't imagined a clean design.&nbsp; I'll keep thinking about it though.&nbsp; If you like you can make a work item to track this.</p>",
    "PostedDate": "2009-07-27T13:41:54.383-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]