The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
June 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Use RandomAccessFile

Posted by Ivan Porty on June 24, 2000 at 11:03 AM

> I could not figure out how to open an existing file and append data to it. Would someone please help?

> Thanks.


Hello,

use following approach. Different types of classes won't
help you here, so you must use class java.io.RandomAccessFile

1. Create object of this class (see online docs for details)
2. Use its method called seek(long), it is intended to search through file. to search to the end, use seek(length()).

For details, see online docs.
Ivan.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us