icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.
http://icsharpcode.github.io/SharpZipLib/
MIT License
3.7k stars 976 forks source link

Add support for DEFLATE64 algorithm when extracting from zip archive #818

Open elitzamarinova opened 1 year ago

elitzamarinova commented 1 year ago

Add support for DEFLATE64 algorithm when extracting from zip archive:

The content of the new classes is borrowed from DEFLATE64 support implementation for DotNetZip which on its part contains modified code from the .NET Core Libraries (CoreFX and System.IO.Compression/DeflateManaged) where deflate64 decompression is implemented.

Other changes are implemented in order to support forward-only stream.

piksel commented 1 year ago

This currently fails 4 tests, and I am not too eager in taking in a whole new Deflate implementation (1800 LoC 😓).

I did some PoC testing in https://github.com/icsharpcode/SharpZipLib/commit/c9589cf493b8fe4f3146d2b72fc2847b068ece45 to see if it could be implemented by allowing the window and max distance to be customized in the existing Deflater. It still needs more testing and a Inflator support, but it looks promising...

elitzamarinova commented 1 year ago

Yes, looks promising. I took a look today at the failings in the tests, seems like the ZipEntry in the ZipInputStream got null somehow.