V
V
Vitaly2014-01-18 21:09:28
Java
Vitaly, 2014-01-18 21:09:28

Java, reading a file

Good day, the question, it would seem, is extremely banal - you need to read the file from the local disk.
What I am doing now:

...
        Book b = new Book();
        try{
        EpubReader reader = new EpubReader();
        File file = new File("E://FW//1.epub");
        FileInputStream fis = new FileInputStream(file);
        InputStream is = fis;
        fis.close();
        b = reader.readEpub(is);
    }
    catch(Exception e){
...
}
    return b;

The streams are stubbornly empty. Tried a variety of variations of the path, \\, \, / and all the rest of the real ones. I tried to use InputStream + bufferedStream instead of fileinputstream, in general, I tried all the adequate options and that's it. what is in Google - a complete zero.
What am I doing wrong and how should I do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Lopatin, 2014-01-18
@lorus

Well you closed the stream before you start reading it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question