Help in creating Zip files from .Net and reading them from Java

前端 未结 6 877
野性不改
野性不改 2021-01-13 18:31

I\'m trying to create a Zip file from .Net that can be read from Java code.

I\'ve used SharpZipLib to create the Zip file but also if the file generated is valid acc

6条回答
  •  被撕碎了的回忆
    2021-01-13 18:51

    You don't wanna use the ZipPackage class in .NET - it isn't quite a standard zip model. Well it is, but it presumes a particular structure in the file, with a manifest with a well-known name, and so on. ZipPackage seems to have been optimized for Office docs and XPS docs.

    A third-party library, like http://www.codeplex.com/DotNetZip, is probably a better bet if you are doing general-purpose ZIP files and want good interoperability.

    DotNetZip builds files that are very interoperable with just about everything, including Java's java.utils.zip. But be careful using features that Java does not support, like ZIP64 or Unicode. ZIP64 is useful only for very large archives, which Java does not support well at this time, I think. Java supports Unicode in a particular way, so if you produce a Unicode-based ZIP file with DotNetZip, you just have to follow a few rules and it will work fine.

提交回复
热议问题