inkfish原创,请勿商业性质转载,转载请注明来源(http://blog.csdn.net/inkfish)。
这里需要关注的是BZIP2格式,经过测试,总是无法正确压缩,原因未知,而apache commons bzip2格式的文件压缩正常。
Ant ZIP压缩:
Ant BZIP压缩:
Ant TAR打包:
注:org.apache.commons.io包为Apache common io,项目首页:http://commons.apache.org/io/ ,提供了IO操作的很多方便的方法,基于Apache 2.0 License,可用于商业用途。