Decompressing a zipfile into memory stream - C#
<p>I have written code to store the encoded string of zip file into temp path and now I want to store the encoded zipfile string to memorystream instead of temp path. Can someone please help me how to read the stream and pass it as a string to ZipFile class...I am using DOTNETZIP library to unpack password protested file.
Please see below my code.</p>

<pre><code>string tempPath = Path.GetTempPath();                        

foreach (ActivityMimeAttachment a in attachments.Entities)
{
    if (a.FileName.EndsWith(".zip", StringComparison.OrdinalIgnoreCase))
    {
        string strcontent = a.Body;

        byte[] filecontent = Convert.FromBase64String(strcontent); // unpack the base-64 to a blob      

        File.WriteAllBytes(tempPath + a.FileName, filecontent); // Working code creates a zip file           
        string attachmentfile = tempPath + a.FileName;                                

            using (ZipFile zip = new ZipFile(attachmentfile))
            {
                foreach (ZipEntry entry in zip.Entries)
                {

                    if ((entry.FileName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)) ||
                        (entry.FileName.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase)))
                    {                                                
                        entry.ExtractWithPassword(tempPath, "password");

                        FileStream inFile;
                        byte[] binaryData;
                        string file = tempPath + entry.FileName;

                        inFile = new FileStream(file, FileMode.Open, FileAccess.Read);
                        binaryData = new Byte[inFile.Length];
                        long bytesRead = inFile.Read(binaryData, 0,
                                             (int)inFile.Length);
                        inFile.Close();
</code></pre>