{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "Duplicate&#58;  7860",
    "ClosedDate": "2009-06-13T12:31:03.607-07:00",
    "CommentCount": 0,
    "Custom": null,
    "Description": "To write directly from the buffer into a new ZipEntry, add:\n \nto Ionic.Zip.SharedUtilities:\n \n\t/// <summary>\n        /// Creates a <c>MemoryStream</c> for the given buffer. This is used internally by Library, specifically by \n        /// the ZipFile.AddFileFromBuffer() method.   But it may be useful in other scenarios. \n        /// </summary>\n        /// <param name=\"b\">The buffer to use as input for the MemoryStream</param>\n        /// <returns>the MemoryStream. Reading the stream will give you the content of the String.</returns>\n        public static System.IO.MemoryStream BufferToMemoryStream(byte[] b)\n        {\n          System.IO.MemoryStream m = new System.IO.MemoryStream();\n          System.IO.StreamWriter sw = new System.IO.StreamWriter(m);\n          sw.Write(b);\n          sw.Flush();\n          return m;\n        }\n \nto Ionic.Zip.ZipFile:\n \n\t/// <summary>\n        /// Adds an entry into the zip archive using the given filename and directory path within the archive,\n        /// and the given content for the file.  No file is created in the filesystem.  \n        /// </summary>\n        /// <param name=\"buffer\">The buffer of the file, should it be extracted from the zip.</param>\n        /// <param name=\"fileName\">The filename to use within the archive.</param>\n        /// <param name=\"directoryPathInArchive\">\n        /// Specifies a driectory path to use to override any path in the ItemName.\n        /// This path may, or may not, correspond to a real directory in the current filesystem.\n        /// If the files within the zip are later extracted, this is the path used for the extracted file. \n        /// Passing null (nothing in VB) will use the path on the FileName, if any.  Passing the empty string (\"\")\n        /// will insert the item at the root path within the archive. \n        /// </param>\n        /// <returns>The ZipEntry added.</returns>\n        public ZipEntry AddFileFromBuffer(string fileName, string directoryPathInArchive, byte[] buffer)\n        {\n          System.IO.MemoryStream ms = SharedUtilities.BufferToMemoryStream(buffer);\n          return AddFileStream(fileName, directoryPathInArchive, ms);\n        }",
    "LastUpdatedDate": "2013-05-16T05:32:19.153-07:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2009-06-11T16:41:39.127-07:00",
    "Status": {
      "Name": "Closed",
      "Id": 4
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Add: Direct write from buffer",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 7880
  },
  "FileAttachments": [],
  "Comments": []
}