TrainBeaser for iPhone
The moose likes I/O and Streams and the fly likes I/O BufferedInputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "I/O BufferedInputStream" Watch "I/O BufferedInputStream" New topic
Author

I/O BufferedInputStream

Nils Persson
Greenhorn

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: java.io.EOFException
java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:343)
at FileBuff.main(FileBuff.java:27)
Something wrong with the file (just a text file) or with the readInt()?
Melynda Coxx
Greenhorn

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

to

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

Joined: May 25, 2001
Posts: 21
Yes of course, thanks!
 
IntelliJ Java IDE
 
subject: I/O BufferedInputStream
 
Threads others viewed
Basic: How IO reads or write ByteStream and CharacterStream
Copying a Binary (EXE) file
PDF writing woes
Problem in copying JAR file
What does this code mean?
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture