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 对象就都被关闭了。

时间: 2024-11-08 08:10:38

java.io.IOException: The stream is closed的相关文章

java.io.IOException: Attempted read from closed stream

代码如下,执行的时候提示“java.io.IOException: Attempted read from closed stream.” @Test public void test_temp(){ String url="http://ssov1.59iedu.com/login?TARGET=http://med.ihbedu.com:80/gateway/web/sso/auth&js&callback=loginThen&1470491151264&no

java.io.IOException: Stream closed 异常的原因和处理

java.io.IOException: Stream closed 多个线程索引同一个input  stream,当某一个thread在执行完之后,把这个inputstream关闭了:而此时正在从这个input  stream流中读取信息的线程就会抛出  java.io.IOException:  Stream  closed  异常. 终于找到这个异常的根源所在,原来是两个页面同时调用一个jsp,这个jsp中的内建对象out在执行out.close()时发生的异常,也就是当某一个thread

Java导出Excel,java.io.IOException: Stream is already closed

使用POI进行Excel导出的时候,后台报了这样一个错误: java.io.IOException: Stream is already closed 导出的代码如下: 查了半天,才发现问题出在第409行 out.close(); out这个输出流是不用自己手动关闭的,系统会自动替我们关闭,自己手动关闭的话还会引发问题. 实际上只有像下面这种使用new关键字创建的输入/输出流,才需要自己手动关闭 InputStream input = new FileInputStream(new File("

java.io.IOException: read failed, socket might closed or timeout, read ret: -1

近期项目中连接蓝牙之后接收蓝牙设备发出的指令功能,在连接设备之后,创建RfcommSocket连接时候报java.io.IOException: read failed, socket might closed or timeout, read ret: -1错误.以下说一下我的解决方法,希望对各位有一点帮助. private BluetoothSocket mSocket; <span style="white-space:pre"> </span>priva

java.io.IOException: java.io.EOFException: Unexpected end of input stream错误

报错现象: Diagnostic Messages for this Task:Error: java.io.IOException: java.io.EOFException: Unexpected end of input stream at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderNextException(HiveIOExceptionHandlerChain.java:121) at

坑爹微信之读取PKCS12流时出现的java.io.IOException: DerInputStream.getLength

背景 微信退款接口需要使用到证书,我参考微信的官方Demo进行,部分代码如下: char[] password = config.getMchID().toCharArray(); InputStream certStream = config.getCertStream(); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(certStream, password); 上面的代码,在本地调试的时候正常跑过,没有出现任何异常,

Hive报错 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D

报错信息如下 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D 解决方法: 编辑 hive-site.xml 文件,添加下边的属性 <property> <name>system:java.io.tmpdir<

java.io.IOException: No space left on device 错误

今天碰到比较奇怪的问题: 7/05/14 19:20:24 INFO util.Utils: Fetching http://192.168.31.160:33039/jars/spark_study_java-0.0.1-SNAPSHOT-jar-with-dependencies.jar to /tmp/spark-446068a4-aaa4-4277-b009-908bf0d4ecac/executor-dcc3175b-7d19-4485-81e1-bf31a83a66b4/spark-

spark程序异常:Exception in thread &quot;main&quot; java.io.IOException: No FileSystem for scheme: hdfs

命令: java -jar myspark-1.0-SNAPSHOT.jar myspark-1.0-SNAPSHOT.jar hdfs://single:9000/input/word.txt hdfs://single:9000/output/out1 错误信息: .......... 14/11/23 06:14:18 INFO SparkDeploySchedulerBackend: Granted executor ID app-20141123061418-0011/0 on hos