[
  {
    "Id": "656789",
    "ThreadId": "268751",
    "Html": "\r\n<p>I have read the doc on the technical reasons why you have to call this before calling Write, but I am not sure why they exist.</p>\r\n<p>If I want to just compress a single stream into another stream (any stream may not be a file) I don't care about an actual entry, so I have to set this to something and when dealing with two streams and neither are files I have no way to safely determine\r\n this.&nbsp;</p>\r\n<p>I was wondering if there are any good work around for treating a ZipOutputStream like the GZipStream basically. &nbsp;Where there will only be one item in the file that is compressed.</p>\r\n",
    "PostedDate": "2011-08-11T12:36:21.147-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "656791",
    "ThreadId": "268751",
    "Html": "<p>The Zip file has a structure called an \"entry\" in it.&nbsp; This is described in the specification for ZIP file structures, which is a document put out by PKWare.&nbsp; The ZIP spec says that each item in a zipfile is an entry, and each entry has a name.</p>\r\n<p>The zipfile archive structure doesn't say that entries must correspond to files, or must be filled with compressed data that originated within a file. BUT, the zip spec says each entry has a name.&nbsp;</p>\r\n<p>That's why you need to call ZipOutputStream.PutNextEntry()</p>\r\n<p>I'm not sure what you mean by \"work around\".&nbsp; I don't see the problem you are trying to solve.&nbsp;&nbsp; If you want a 1-item compressed archive, use GZipStream, or DeflateStream, or ZlibStream.&nbsp; If you want to produce a zip archive, you can use ZipOutputStream.&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-11T12:40:11.56-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "656795",
    "ThreadId": "268751",
    "Html": "<p>Okay let me rephrase... why does PutNextEntry require a stirng? &nbsp;That is my real issue, I understand the Zip format and the concept of Entries, but as I stated when you are dealing with streams that are not FileStreams then you don't have easy to use \"entryName\" like a file name would be. &nbsp;Why can't I just a single entry with out a name?</p>",
    "PostedDate": "2011-08-11T12:49:44.267-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "656820",
    "ThreadId": "268751",
    "Html": "<p>I don't understand your confusion. Maybe I was not clear, so I will just state in&nbsp;a different way what I wrote earlier.&nbsp;&nbsp;PutNextEntry() accepts a name because each entry in a zipfile requires a name.&nbsp; A zipfile consists of entries, each of which has a name.&nbsp; PutNextEntry is the way for your app to say, \"here comes a new entry (and its name is XXXX)\" .</p>\r\n<p>The issue of whether an arbitrary&nbsp;stream in&nbsp;your .NET application has a name associated to it has nothing to do with the zipfile structure.&nbsp; The zipfile structure is what it is; the&nbsp;ZipOutputStream class in DotNetZip is shaped the way it is, in order to expose the zipfile&nbsp;structure in a usable way to applications.&nbsp;Each entry in a zip requires a name; when creating zip files, it's up to you and your app to decide what to specify for the name on each entry.&nbsp;</p>\r\n<p>As I said, if you have only one item in the compressed archive, then you may want to consider using a bare GZipStream in lieu of a ZipOutputStream. The GZipStream accepts only one compressed blob, and there's no need to specify a name for it.</p>",
    "PostedDate": "2011-08-11T13:56:43.443-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "656830",
    "ThreadId": "268751",
    "Html": "<p>First Zip is better than GZip at compression so that would be a good reason not to use GZip even if its a single item or non-file streams.</p>\r\n<p>Also I am just asking I guess why does an entry require a name, can I make it an empty string or null? I mean when I extra the files I don't have to extract by name if I don't want to. &nbsp;</p>\r\n<p>I have working code, just had this odd issue comes up in a corner case dealing with a non-file stream and I cannot get a \"name\" that the call would understand, so I can create a new Guid, or a default string like \"Unknown\" but it seems like I have to give it something. So that triggered me to ask the question, I am perfectly okay if a non-empty non-null string is required, figured it couldn't hurt to ask about it though. :)</p>",
    "PostedDate": "2011-08-11T14:07:57.47-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "656834",
    "ThreadId": "268751",
    "Html": "<p>&gt; First Zip is better than GZip at compression</p>\r\n<p>Not true.&nbsp; In most cases, Zip merely wraps the DeflateStream, which is essentially the same as GZipStream.&nbsp; Think of a Zip as a container around multiple DeflateStreams. It is not \"better\" in compression.&nbsp; It's a box that holds smaller compressed boxes. For one file, normally GZipStream will be smaller than a zipfile. &nbsp;</p>\r\n<p>&gt; Also I am just asking I guess why does an entry require a name,</p>\r\n<p>I understand what you are asking.&nbsp; You have asked three times. I have responded directly and clearly to your question, twice. The answer is still the same, so I won't repeat it here.</p>\r\n<p>&gt; can I make it an empty string or null?</p>\r\n<p>I think not. Try it and see, but I would expect an exception to be thrown somewhere. The entry needs a name.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-08-11T14:14:42.733-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]