This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSCD & RandomAccessFile... is it ok?  RSS feed

 
Bernardo Sana
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am making extensive usage of the RandomAccessFile class in my project, but I am not sure if this is really correct.

There reason why I am asking it is because of a few lines of my specification, which says " All numeric values stored i the header information use the formats of the DataInputStream and DataOutputStream classes (...)".

By reading it, I have the felling the using RandomAccessFile for reading the database file is just wrong, however, making direct use of DataInputStream and DataOutputStream would make the code much more complex.

Would it be a mistake to use the RandomAccessFile?

Any help would be highly appreciated.

Thanks in advance,

Bernardo Sana
 
Josh Allen
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RandomAccessFile implements DataInput and DataOutput, just like DataInputStream and DataOutputStream.

API docs
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!