violet kiwi
violet kiwi

Reputation: 705

What is the advantage of using Random Access File instead of FIle Writer and FileReader?

I understood the classes FileWriter and File Reader.

I want to know about the class RandomAccessFile compared to FileWriter and FileReader.

Upvotes: 0

Views: 3040

Answers (1)

Peter Lawrey
Peter Lawrey

Reputation: 533492

The RandomAccessFile is designed for random access of binary data. i.e. you can access anywhere in the file by index.

FileReader and FileWriter are for reading and writing text, not binary, sequentially.

Upvotes: 6

Related Questions