The way
Java implemented I/O Streams allows you to mix their capabilities together, which can be a really powerful feature. In this case, you need a BufferedInputStream to improve performance. Something like:
That's a stream that reads from the file "myfile.dat" into a 4096 byte buffer, and then parses your data out of the buffer. You get the data interface while still minimizing slow disk I/O calls.
This technique wouldn't really work with a RandomAccessFile though since that lets you jump around the file and read or write.