一个关于解析ZIP流文件格式的问题
我写了一个解析ZIP文件的CLASS,但是不知道为什么,总是只能解析出一个FILE,然后便抛出“STREAM CLOSED”异常,可是我希望能够解析出所有文件。
有人能帮我下吗
具体代码如下:
private void WorkDone() {
try{
ZipInputStream zip_In=new ZipInputStream(new FileInputStream(selfFile));
ZipEntry entry;
while((entry=zip_In.getNextEntry())!=null){
byte[] buff=new byte[4096];
BufferedInputStream bin=new BufferedInputStream(zip_In);
BufferedOutputStream bout=new BufferedOutputStream(new FileOutputStream(entry.getName()));
System.out.println("File: "+entry.getName()+" has been extracted!");
while(bin.read(buff,0,1)!=-1){
bout.write(buff,0,1);
}
bout.close();
bin.close();
zip_In.closeEntry();
}
zip_In.close();
}catch(IOException exceptionHere){
System.out.println(exceptionHere);
System.exit(0);
}
}
有人能帮我下吗
具体代码如下:
private void WorkDone() {
try{
ZipInputStream zip_In=new ZipInputStream(new FileInputStream(selfFile));
ZipEntry entry;
while((entry=zip_In.getNextEntry())!=null){
byte[] buff=new byte[4096];
BufferedInputStream bin=new BufferedInputStream(zip_In);
BufferedOutputStream bout=new BufferedOutputStream(new FileOutputStream(entry.getName()));
System.out.println("File: "+entry.getName()+" has been extracted!");
while(bin.read(buff,0,1)!=-1){
bout.write(buff,0,1);
}
bout.close();
bin.close();
zip_In.closeEntry();
}
zip_In.close();
}catch(IOException exceptionHere){
System.out.println(exceptionHere);
System.exit(0);
}
}
...全文
相关推荐
Tsr.zip_PAT PMT_TSR_dvb-c_tsr ts流_tsr.exe
DVB 能完整的解析出TS流文件中的PAT,PMT,NIT,CAT信息,并且能兼容188和204的TS流文件
C语言TS流文件解析,JNI库.zip
C语言TS流文件解析,JNI库.zip
MPEG2TS流解析程序,输入为TS流文件,可以将视频和音频解析出来.zip
MPEG2TS流解析程序,输入为TS流文件,可以将视频和音频解析出来.zip
H.264码流文件.zip
内含通过FPGA纯硬件压缩的的几个H.264的码流文件,包含4中不同码率的文件。纯硬件实现,非软件实现的压缩
Angular利用HTTP POST下载流文件的步骤记录
Angular / Vue HTTP POST下载流文件 HTTP POST 请求流文件转成excel 在使用Angular开发项目时,通常会有下载文件的功能项。一般是后台返回下载地址,通过 标题或者使用 window 打开下载地址新窗口,浏览器则会识别出流文件进行文件下载。 但是,有时候进行http异步请求,后台返回的并不是下载地址,而是直接返回一个文件流,这时如何使用http请求回来的文件流转换成文件下载? 其实并非Angular框架存地这样的情况,其他PWA如Vue,React甚至Jquery都通过http xhr进行请求而获取的流文件,浏览器也并不会自动识别并自动下载。 那当


Java SE
