File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes I/O BufferedInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "I/O BufferedInputStream" Watch "I/O BufferedInputStream" New topic

I/O BufferedInputStream

Nils Persson

Joined: May 25, 2001
Posts: 21
I have trouble using BufferedInputStream. I'm trying to read the int I just have written to the file. Is the code OK?
I get the error text:
IOException in DataFiles:
at FileBuff.main(
Something wrong with the file (just a text file) or with the readInt()?
Melynda Coxx

Joined: Jan 30, 2002
Posts: 7
Reverse the order of your 3 close calls. They are backwards...
i.e. change


It worked for me.
[ January 31, 2002: Message edited by: Melynda Coxx ]
Nils Persson

Joined: May 25, 2001
Posts: 21
Yes of course, thanks!
I agree. Here's the link:
subject: I/O BufferedInputStream
It's not a secret anymore!