一个ZIP的压缩文件的问题
FileOutputStream f = new FileOutputStream( "test.zip ");
CheckedOutputStream csum =
new CheckedOutputStream(f, new Adler32());
ZipOutputStream zos = new ZipOutputStream(f);
BufferedOutputStream out =
new BufferedOutputStream(zos);
zos.setComment( "A test of Java Zipping ");
// No corresponding getComment(), though.
for(int i = 0; i < args.length; i++) {
System.out.println( "Writing file " + args[i]);
BufferedReader in =
new BufferedReader(new FileReader(args[i]));
zos.putNextEntry(new ZipEntry(args[i]));
int c;
while((c = in.read()) != -1)
out.write(c);
in.close();
}
out.close();
我的命令行参数是3个文件。
我把压缩文件打开结果所有内容都压到一个文件里面去了,另外两个文件为空,这怎么回事?如何才能将内容放在本来的文件里
------解决方案--------------------能说清楚点吗?我看得不太懂哦