Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

JSCD & RandomAccessFile... is it ok?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RandomAccessFile implements DataInput and DataOutput, just like DataInputStream and DataOutputStream.

API docs
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic