I am trying to read the contents of an ePub file using the epublib library, and this example demonstrates this.
An exception occurs for me when loading a book from the input stream
// Load Book from inputStream Book book = (new EpubReader()).readEpub(epubInputStream);
Not sure why the code doesn't work, and an exception is thrown for me? It worked for other StackOverflow users.
The Full Stack trace is used below:
W/System.err: java.io.EOFException W/System.err: at libcore.io.Streams.readFully(Streams.java:83) W/System.err: at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:235) W/System.err: at nl.siegmann.epublib.epub.EpubReader.readResources(EpubReader.java:184) W/System.err: at nl.siegmann.epublib.epub.EpubReader.readEpub(EpubReader.java:94) W/System.err: at nl.siegmann.epublib.epub.EpubReader.readEpub(EpubReader.java:53) W/System.err: at nl.siegmann.epublib.epub.EpubReader.readEpub(EpubReader.java:37) W/System.err: at com.blogspot.gsrikar.ePubViewerActivity.readEPubContents(ePubViewerActivity.java:102) W/System.err: at com.blogspot.gsrikar.ePubViewerActivity.onCreate(ePubViewerActivity.java:88) W/System.err: at android.app.Activity.performCreate(Activity.java:6904) W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266) W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) W/System.err: at android.app.ActivityThread.-wrap17(ActivityThread.java) W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err: at android.os.Looper.loop(Looper.java:148) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7325) W/System.err: at java.lang.reflect.Method.invoke(Native Method) W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
android epub epublib
Srikar reddy
source share