简体   繁体   English

使用ant进行gzip最大压缩

[英]gzip maximum compression using ant

The GZip task in ant works no problem, but is there a way to get it to use maximum compression - the equivalent of gzip -9 ? ant中的GZip任务没有问题,但有没有办法让它使用最大压缩 - 相当于gzip -9

I don't want to just use the native exec task because then I'll lose cross platform compatibility. 我不想只使用本机exec任务,因为那样我将失去跨平台兼容性。

The reason I ask is because I need to compress the changelog with gzip to include in a debian package (also generated via ant) and unless it uses maximum comrpession lintian spouts out a warning (which I'd obviously like to avoid.) 我问的原因是因为我需要使用gzip压缩changelog以包含在debian包中(也通过ant生成),除非它使用最大的comrpession lintian spout out警告(我显然想要避免)。

Why cant you create a small program with this http://commons.apache.org/compress/ 为什么你不能用这个http://commons.apache.org/compress/创建一个小程序

try this .. http://bytemycode.com/snippets/snippet/178 for setting compression level feature to GZipOut Stream 试试这个.. http://bytemycode.com/snippets/snippet/178 ,将压缩级别功能设置为GZipOut Stream

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM