java.io.IOException: The stream is closed
at org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.read(ZipArchiveInputStream.java:362)
at java.io.InputStream.read(Unknown Source)
at org.apache.commons.compress.utils.IOUtils.copy(IOUtils.java:75)
at org.apache.commons.compress.utils.IOUtils.copy(IOUtils.java:56)
at com.xunge.AESFileEncoder.unzip(AESFileEncoder.java:175)
at com.xunge.AESFileEncoder.unzip(AESFileEncoder.java:94)
at com.xunge.AESFileEncoder.main(AESFileEncoder.java:476)
java.io.IOException: This archive contains unclosed entries.
at org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:410)
at com.xunge.AESFileEncoder.unzip(AESFileEncoder.java:98)
at com.xunge.AESFileEncoder.main(AESFileEncoder.java:476)
相关代码:
ArchiveInputStream inJar = new ArchiveStreamFactory()
.createArchiveInputStream(ArchiveStreamFactory.JAR,
ais);
需要注意的是,使用ArchiveInputStream创建的ArchiveInputStream 对象如果关闭,则所有与之相关的ArchiveInputStream 对象就都被关闭了。