C
csharpula csharp
Hello ,
In case someone uses SharpZipLib :
I am using SharpZipLib in order to compress and decompress gzip files. I
decompress a fie which was compressed with SharpZipLib code in a
following way:
//args[0] - gzip file ,args[1] - folder to extract to
TarArchive archive = null;
using (Stream s = new GZipInputStream(File.OpenRead(args[0])))
{
archive = TarArchive.CreateInputTarArchive(s);
if (!Directory.Exists(args[1]))
{
Directory.CreateDirectory(args[1]);
}
archive.ExtractContents(args[1]);
But I get the following error (for inpur that was also compressed by
SharpZipLib code) : Error GZIP header, first magic byte doesn't match.
Why is that? How can I solve this?
Thanks!
In case someone uses SharpZipLib :
I am using SharpZipLib in order to compress and decompress gzip files. I
decompress a fie which was compressed with SharpZipLib code in a
following way:
//args[0] - gzip file ,args[1] - folder to extract to
TarArchive archive = null;
using (Stream s = new GZipInputStream(File.OpenRead(args[0])))
{
archive = TarArchive.CreateInputTarArchive(s);
if (!Directory.Exists(args[1]))
{
Directory.CreateDirectory(args[1]);
}
archive.ExtractContents(args[1]);
But I get the following error (for inpur that was also compressed by
SharpZipLib code) : Error GZIP header, first magic byte doesn't match.
Why is that? How can I solve this?
Thanks!