在读取文件流时,不足一个读取单位是的处理

// 将压缩文件中的内容读取出来,并写进解压缩文件中
InputStream is = zf.getInputStream(entry);
FileOutputStream fos = new FileOutputStream(currentFile);
byte[] bs = new byte[1024];
int len;
while ((len=is.read(bs)) > 0) {
fos.write(bs, 0, len);
}
is.close();
fos.close();

posted @ 2018-01-12 14:45  Java开发小菜鸟  阅读(217)  评论(0编辑  收藏  举报