Reputation: 2504
All,
I have a requirement to Compress an XML file. At the moment I am using C# and the gzip algorithm in the .NET Classes. I does compress it but not at the rate I would like to. For example a 12MB file was compressed to a little less than 4MB.
Is there any other way to compress it more than that? Speed of compression / decompression is not very important.
Thanks, M
Upvotes: 1
Views: 659
Reputation: 117029
Take a look at System.IO.Packaging.ZipPackage
in WindowsBase
. It's the .NET framework code behind the DOCX & XLSX file formats and these are more or less zipped XML files. You can zip multiple files of any format together, not just XML.
Upvotes: 0
Reputation: 6916
This website compared different compression libraries against large amount of text data. 7-zip is also included. I hope that this helps you to choose correct library that matches your requirements.
Upvotes: 0
Reputation: 47038
Use the client version of 7-zip to try different compression settings to find the one with best compression for your particular data set.
Upvotes: 0
Reputation: 176159
ZIP compression is well suited for compressing XML data. In .NET you best rely on third party libraries:
Upvotes: 2