我试图将InputStream放入文件并获取以下堆栈跟踪:
org.springframework.amqp.rabbit.listener.ListenerExecutionFailedException: Listener method 'handleMessage' threw exception
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.UndeclaredThrowableException
... 1 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
以下是导致它的代码段
HSLFSlideShow ppt = new HSLFSlideShow(fs)
ObjectData[] embeddes = ppt.getEmbeddedObjects()
embeddes.eachWithIndex { ObjectData entry, int i ->
File f = new File (fileToSave)
f.withOutputStream { w ->
w << entry.getData() //This causes the error
}
}
以下是ObjectData
类getData()
方法https://poi.apache.org/apidocs/org/apache/poi/hslf/usermodel/ObjectData.html#getData()
我正在使用Apache POI 3.10-FINAL