android - EOFException is thrown when reading contents of an ePub file -
i'm trying read contents of epub file using library epublib , example demonstrates that.
for me, exception thrown when loading book input stream
// load book inputstream book book = (new epubreader()).readepub(epubinputstream);
not sure why code isn't working , exception thrown me? has worked other users of stackoverflow.
full stack trace shared below:
w/system.err: java.io.eofexception w/system.err: @ libcore.io.streams.readfully(streams.java:83) w/system.err: @ java.util.zip.zipinputstream.getnextentry(zipinputstream.java:235) w/system.err: @ nl.siegmann.epublib.epub.epubreader.readresources(epubreader.java:184) w/system.err: @ nl.siegmann.epublib.epub.epubreader.readepub(epubreader.java:94) w/system.err: @ nl.siegmann.epublib.epub.epubreader.readepub(epubreader.java:53) w/system.err: @ nl.siegmann.epublib.epub.epubreader.readepub(epubreader.java:37) w/system.err: @ com.blogspot.gsrikar.epubvieweractivity.readepubcontents(epubvieweractivity.java:102) w/system.err: @ com.blogspot.gsrikar.epubvieweractivity.oncreate(epubvieweractivity.java:88) w/system.err: @ android.app.activity.performcreate(activity.java:6904) w/system.err: @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1136) w/system.err: @ android.app.activitythread.performlaunchactivity(activitythread.java:3266) w/system.err: @ android.app.activitythread.handlelaunchactivity(activitythread.java:3415) w/system.err: @ android.app.activitythread.-wrap17(activitythread.java) w/system.err: @ android.app.activitythread$h.handlemessage(activitythread.java:1821) w/system.err: @ android.os.handler.dispatchmessage(handler.java:102) w/system.err: @ android.os.looper.loop(looper.java:148) w/system.err: @ android.app.activitythread.main(activitythread.java:7325) w/system.err: @ java.lang.reflect.method.invoke(native method) w/system.err: @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1230) w/system.err: @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1120)
eofexception thrown:
if there no data in stream trying read.. eg read methods of chain streams datainputstream, objectinputstream throw eofexception if trying read fileinputstream fileinputstream empty or
if formats not matching...eg if int present , using readfloat() of datainputstream
Comments
Post a Comment