Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

The magic number in GZip header is not correct. Make sure you are passing in a GZip stream

$
0
0
using ICSharpCode.SharpZipLib.BZip2;
using ICSharpCode.SharpZipLib.Core;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Tar;
  public static void ExtractTGZ(String gzArchiveName, String destFolder)
        {
            try
            {
                Stream inStream = File.OpenRead(gzArchiveName);
                Stream gzipStream = new GZipInputStream(inStream);
                TarArchive tarArchive = TarArchive.CreateInputTarArchive(gzipStream);
                tarArchive.ExtractContents(destFolder);
                tarArchive.Close();
 
                gzipStream.Close();
                inStream.Close();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
  am gettng this error 
am getting the following error 
The magic number in GZip header is not correct. Make sure you are passing in a GZip stream


Viewing all articles
Browse latest Browse all 1764

Trending Articles