[英]Java call terminated by uncaught Java exception: java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB input stream
I am getting this error when size of ZipInputStream is more than 1 Gb but it is working fine for 500mb data; 当ZipInputStream的大小大于1 Gb,但对于500mb数据工作正常时,我会收到此错误;
Java call terminated by uncaught Java exception: java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB input stream Java调用因未捕获的Java异常而终止:java.lang.RuntimeException:java.io.EOFException:ZLIB输入流的意外结束
conn = (oracle.jdbc.OracleConnection)new OracleDriver().defaultConnection();
newBlob=conn.createBlob();
InputStream is = blob.getBinaryStream();
ZipInputStream zis = new ZipInputStream(is);
//get the zipped file list entry
ZipEntry ze = zis.getNextEntry();
while (ze != null) {
OutputStream os = newBlob.setBinaryStream(1);
while (zis.available() != 0) {
os.write(zis.read());
}
os.flush();
ze = zis.getNextEntry();
}
zis.closeEntry();
zis.close();
But if I am using 但是如果我正在使用
newBlob = BLOB.createTemporary(conn, false,oracle.sql.BLOB.DURATION_SESSION); newBlob = BLOB.createTemporary(conn,false,oracle.sql.BLOB.DURATION_SESSION); this, then it is working fine.
这个,然后工作正常。
Please Help. 请帮忙。 Thanks in advance
提前致谢
使用InputStream.available()
不是检测文件结尾的正确方法: InputStream.available()不起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.