首页新闻找找看学习计划

java.io.EOFException 怎么处理

0
悬赏园豆:100 [待解决问题]

DicomInputStream dis = null;
DicomObject dio = null;

try{
dis = new DicomInputStream(f);
dio = dis.readDicomObject();//这里抛出异常

 

 

java.io.EOFException
at org.dcm4che2.io.DicomInputStream.readFully(DicomInputStream.java:351)
at org.dcm4che2.io.DicomInputStream.readBytes(DicomInputStream.java:654)
at org.dcm4che2.io.DicomInputStream.readValue(DicomInputStream.java:590)
at org.dcm4che2.io.DicomInputStream.parse(DicomInputStream.java:518)
at org.dcm4che2.io.DicomInputStream.readItems(DicomInputStream.java:606)
at org.dcm4che2.io.DicomInputStream.readValue(DicomInputStream.java:588)
at org.dcm4che2.io.DicomInputStream.parse(DicomInputStream.java:518)
at org.dcm4che2.io.DicomInputStream.readDicomObject(DicomInputStream.java:415)
at org.dcm4che2.io.DicomInputStream.readItemValue(DicomInputStream.java:637)
at org.dcm4che2.io.DicomInputStream.readValue(DicomInputStream.java:566)
at org.dcm4che2.io.DicomInputStream.parse(DicomInputStream.java:518)
at org.dcm4che2.io.DicomInputStream.readItems(DicomInputStream.java:606)
at org.dcm4che2.io.DicomInputStream.readValue(DicomInputStream.java:588)
at org.dcm4che2.io.DicomInputStream.parse(DicomInputStream.java:518)
at org.dcm4che2.io.DicomInputStream.readDicomObject(DicomInputStream.java:415)
at org.dcm4che2.io.DicomInputStream.readDicomObject(DicomInputStream.java:423)
at com.shenzhou.feiyun.protocol.dicom.DicomReveiver.receiveData(DicomReveiver.java:88)
at com.shenzhou.feiyun.integration.framework.TemplateIntegrator.transferOne2One(TemplateIntegrator.java:73)
at com.shenzhou.feiyun.integration.framework.TemplateIntegrator.transfer(TemplateIntegrator.java:106)
at com.shenzhou.feiyun.integration.framework.TemplateIntegrator.doJob(TemplateIntegrator.java:96)
at com.shenzhou.feiyun.integration.framework.TaskRunner.runWork(TaskRunner.java:63)
at com.shenzhou.feiyun.integration.framework.TaskRunner.access$000(TaskRunner.java:16)
at com.shenzhou.feiyun.integration.framework.TaskRunner$1.run(TaskRunner.java:45)
at java.lang.Thread.run(Thread.java:748)

w的世界的主页 w的世界 | 初学一级 | 园豆:4
提问于:2017-12-21 20:04
< >
分享
所有回答(3)
0

setStreamPosition(0L)

Daniel Cai | 园豆:10374 (专家六级) | 2017-12-21 20:53

能解释的详细点?

 

支持(0) 反对(0) w的世界 | 园豆:4 (初学一级) | 2017-12-22 10:57

@w的世界: 没用过这个,但既然你流都已经到eof了,那么把流再设到头上看下

支持(1) 反对(0) Daniel Cai | 园豆:10374 (专家六级) | 2017-12-22 12:48
0

EOFException表示输入过程中意外地到达文件尾或流尾的信号,导致从session中获取数据失败。异常是tomcat本身的问题,由于tomcat上次非正常关闭时有一些活动session被持久化(表现为一些临时文件),在重启时,tomcat尝试去恢复这些session的持久化数据但又读取失败造成的。此异常不影响系统的使用。

码农老黄 | 园豆:34 (初学一级) | 2017-12-22 14:03

是一个纯java的项目,没有用tomcate

支持(0) 反对(0) w的世界 | 园豆:4 (初学一级) | 2017-12-22 14:05
0

有心想赚你这100分。但是找不到 org.dcm4che2.io.DicomInputStream 这个包。。。呵呵,你能把这个maven的坐标发给我吗?

David5201 | 园豆:534 (小虾三级) | 2017-12-24 23:58

我用的是本地包,我也没找到maven的坐标

支持(0) 反对(0) w的世界 | 园豆:4 (初学一级) | 2017-12-29 11:16
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册