Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gzip maximum compression using ant

Tags:

java

gzip

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?

I don't want to just use the native exec task because then I'll lose cross platform compatibility.

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.)

like image 661
Michael Berry Avatar asked Nov 04 '22 08:11

Michael Berry


1 Answers

Why cant you create a small program with this http://commons.apache.org/compress/

try this .. http://bytemycode.com/snippets/snippet/178 for setting compression level feature to GZipOut Stream

like image 147
Dipin Avatar answered Nov 09 '22 09:11

Dipin