File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes i'm desperate - i/o is making me confused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "i Watch "i New topic
Author

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

khella smith
Ranch Hand

Joined: May 06, 2002
Posts: 39
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

Joined: Jul 27, 2001
Posts: 1365
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

Joined: May 06, 2002
Posts: 39
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i'm desperate - i/o is making me confused