//创建压缩流
ZipInputStream zis = new ZipInputStream(new FileInputStream(src));
ZipEntry entry;
while ((entry= zis.getNextEntry())!=null){
System.out.println(entry);
if (entry.isDirectory()){
//在新路径下创建新的文件夹
File file = new File(dest, entry.toString());
file.mkdirs();
}else {
FileOutputStream fos = new FileOutputStream(new File(dest, entry.toString()));
int b;
while ((b=zis.read())!=-1){
//写入
fos.write(b);
}
fos.close();
zis.closeEntry();
}
}
zis.close();
请问这个ZipInputStream没放到循环体里面,为什么zis.read()方法还能动态读取文件?