旧轮胎橡胶颗粒回收:我的压缩文件怎么比没压缩之前的文件还大??

来源:百度文库 编辑:高校问答 时间:2024/05/04 19:40:21
try {
FileInputStream fis = new FileInputStream(fi);
File fo = new File("1.zip");
FileOutputStream fos= new FileOutputStream(fo);
ZipOutputStream zos = new ZipOutputStream(fos);
zos.setMethod(ZipOutputStream.DEFLATED); // 设置压缩方法
zos.setLevel(9);
ZipEntry ze= new ZipEntry(fi.getName());
zos.putNextEntry(ze);
int temp = fis.read();
while (temp != -1) {
zos.write(temp);
temp = fis.read();
}
zos.write(-1);
zos.closeEntry();
zos.finish();
zos.close();
fis.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;

技术问题!