将文件压缩到更小的大小 [英] compress a file to less size
本文介绍了将文件压缩到更小的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我能够在java中压缩文件。但是压缩时无法减小尺寸。
请注意 :文件可以是任何东西.exe或.txt等。
请帮助我做这件事。请让我知道更多信息需要继续这个。
谢谢
Raj
解决方案
参见http://www.oracle.com/technetwork/articles/java/compress-1565076.html [ ^ ]。
首先要注意的是Zipping文件不一定会减小尺寸:某些文件格式已经过高度压缩,将它们放入ZIP存档可以使它们占用更多空间而不是更少 - 这对视频来说非常正确文件等等。
这里有一个如何做的工作示例: http://www.mkyong.com/java/how-to-compress-files-in-zip-format/ [ ^ ] - 比较一下您自己的代码,看看是否有任何重大差异。
HI
I could able to Zip a file in java.But am not able reduce the size while compressing.
Please note:File could be any thing .exe or .txt etc.
Kindly help me for do this.kindly let me know any more information need to proceed this.
Thanks
Raj
解决方案
See http://www.oracle.com/technetwork/articles/java/compress-1565076.html[^].
The first thing to note is the Zipping files will not necessarily reduce the size: some file formats are already highly compressed, and putting them into a ZIP archive can make them take more space instead of less - this is very true for video files and such like.
There is a workign example of how to do it here: http://www.mkyong.com/java/how-to-compress-files-in-zip-format/[^] - compare that code with your own, and see if there are any major differences.
这篇关于将文件压缩到更小的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文