[
  {
    "Id": "647766",
    "ThreadId": "266607",
    "Html": "\r\n<div style=\"color:black; background-color:white\">I have the function below that I assume will compress and zip my file. But the streamed derived from the zipped file is the same as the uncompressed file. I know that zipping is not the same as compressing. I\r\n dont understand why the file is only zipped and it not compressed.</div>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">public</span> System.IO.MemoryStream Compress(<span style=\"color:blue\">string</span> filePath)\r\n        {\r\n            System.IO.MemoryStream stream = <span style=\"color:blue\">new</span> MemoryStream();\r\n\r\n            <span style=\"color:blue\">using</span> (ZipFile zip = <span style=\"color:blue\">new</span> ZipFile())\r\n            {\r\n                zip.UseZip64WhenSaving = Zip64Option.AsNecessary;  <span style=\"color:green\">//for large file                 </span>\r\n\r\n                zip.AddFile(filePath, <span style=\"color:#a31515\">&quot;&quot;</span>);\r\n                zip.Save(stream);\r\n                <span style=\"color:blue\">return</span> stream;\r\n            }\r\n        }\r\n</pre>\r\n<pre>Thanks</pre>\r\n</div>\r\n",
    "PostedDate": "2011-07-26T07:52:13.697-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "647994",
    "ThreadId": "266607",
    "Html": "<p>I don;'t know what you mean by \"the stream derived from the zipped file is the same as the uncompressed file\".&nbsp; The same?&nbsp; How?&nbsp;</p>\r\n<p>You'll have to be a little more precise.</p>\r\n<p>The Zip format uses DEFLATE or some other compression format to squish the file data.&nbsp; But this won't work very well for a previously-compressed file, like MP3, JPG, .mkv, or (lots of other formats).&nbsp; So it is possible to zip a file, which then reduces its size maybe 3% ??&nbsp; and the resulting zip file is approximately the same as the so-called \"uncompressed\" file.</p>\r\n<p>What kind of file are you trying to zip?&nbsp; Is it possible that the file is in a format that is already compressed ?&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2011-07-26T14:59:32.467-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "648024",
    "ThreadId": "266607",
    "Html": "<p>Sorry for the lack of clarity. What I meant was that when I zipped the file and saved it to a memory stream. I am currently away from development computer but I am pretty certain that the files that I am trying to zip are either JPEG, PNG or GIF files. So, that might be the issue. :(</p>\r\n<p>I was using this library because we had some files (mainly images) to send over a network. I felt that file compression would have improved the time for the files to be transferred. I guess I am back to 1^2.</p>",
    "PostedDate": "2011-07-26T16:38:44.547-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "648034",
    "ThreadId": "266607",
    "Html": "<p>Yah, zipping won't squish a JPG, GIF or PNG.&nbsp; They all use compression internally.&nbsp; when dealing with such images, the only benefit a zip would potentially give you is, packaging a set of images together into a single file.</p>",
    "PostedDate": "2011-07-26T17:43:37.493-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "648051",
    "ThreadId": "266607",
    "Html": "<p>Thanks for the info.</p>",
    "PostedDate": "2011-07-26T19:30:39.247-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]