Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am trying the below code, but System.IO.Compression is not supporting for windows phone 8...

C#
public static void Decompress(FileInfo fileToDecompress)
       {
           using (FileStream originalFileStream = fileToDecompress.OpenRead())
           {
               string currentFileName = fileToDecompress.FullName;
               string newFileName = currentFileName.Remove(currentFileName.Length - fileToDecompress.Extension.Length);

               using (FileStream decompressedFileStream = File.Create(newFileName))
               {
                   using (GZipStream decompressionStream = new GZipStream(originalFileStream, CompressionMode.Decompress))
                   {
                       decompressionStream.CopyTo(decompressedFileStream);
                       Console.WriteLine("Decompressed: {0}", fileToDecompress.Name);
                   }
               }

           }
       }
Posted

 
Share this answer
 
Thanks Mehdi Gholam for your response.

I also tried the below,its working :

Solution : Step 1 : Update the nuget package to 2.8 or above
Step 2 : Run Install-Package Microsoft.Bcl.Compression
in Package Manager Console.

Now System.IO.Compression; will support to windows phone.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900