Question

From MSDN: DeflateStream Class

DeflateStream cannot be used to compress files larger than 4 GB.

Are there any other implementations for .NET without the 4 GB limit?

NOTE: I really need to decompress a file in GZ format with content larger than 4 GB. Can any code do that?

Was it helpful?

Solution

Take a look at SharpZipLib. Not sure if it's subject to the same limitation, but worth a look.

OTHER TIPS

FYI, we have removed the 4 GB limit from DeflateStream in .NET 4.

There is sample code at CodeProject using the 7-Zip library.

The license is open, so you should be able to use this in your project.

7-Zip also supports GZ files.

Look for libraries that support DEFLATE64 (not Zip64, that's an extension to the ZIP file format). Xceed Zip for .NET does support Deflate64, and I'm sure others do too.

Having a look around, it seems a lot of people have encountered this problem. System.IO.Compressio.DeflateStream clarifications please seems to be the most comprehensive.

The only implementation I was able to find that seems to overcome this problem by using Zip64 is Xceed Zip for .NET.

However, it is very expensive and I am not sure if it would suite your needs.

Edit:

There does seem to be quite a number of implementations of Zip64 for .NET, but I can't find any that are free.

DotNetZip does ZIP64 for .NET, and it is free. But Zip64 is not the same as Deflate64.

Although that documentation says the 4GB limitation is for both the DeflateStream and GZipStream, only GZipStream is limited because of the CRC32 checksum. If you do not need CRC32 then use DeflateStream.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top