This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

i'm desperate - i/o is making me confused

 
khella smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
R&H says "java's random access files only support seeking relative to the begining of the file,but there are methods that report their current position and length of the file,so it can effectively perform other kinds of seek as long as u are willing to do arithmetic" and in the sumarry says " RAF seeks to any position within a file"
i dont really understand this point 'cause my lecturer said that RAF supports seeking relative to the begining of the file and in mock exams that i have taken it also says so(R&H's mock exam)
if the book says it has methods to seek in any position why does it says it seeks relative to the begging of the file? it has gotten me real confused and some help would be appreciated
khella smith
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java only has a function to go to a position relative to the beginning, as R&H says.
The book also points that you can move to spots like the second to last character by going to the location fileLenth - 3, or five characters back with currentPosition - 5. This is the alternative to a non-existant function like seekFromEnd(2) or goBack(5).
The fact that you can seek any point in the file doesn't conflict with anything. If you couldn't seek any point in the file, it wouldn't really be random access .
That's all the book is saying.
David Weitzman
[ May 07, 2002: Message edited by: David Weitzman ]
 
khella smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanxs alot david its clearer now i kinda get it with ur explanation it helped alot

khella smith
[ May 08, 2002: Message edited by: khella smith ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic