wood burning stoves 2.0
The moose likes I/O and Streams and the fly likes seeking and writing to a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "seeking and writing to a file" Watch "seeking and writing to a file" New topic

seeking and writing to a file

jesse harris
Ranch Hand

Joined: Oct 02, 2000
Posts: 62
I am familiar with the file io in java, but it seems like I have some holes in my understanding that I would greatly appreciate being filled if possible. Now the way I see it you have to use the randomaccessFile class to seek anywhere in a file, but you only hacve very simple write methods associated with that class, white char, writeUTF, what if you want to write a string at a time in ascii format. for exmple I am writing to a log file over and over again and need to write a string at a time, when I use the writeUTF method and view the file in notepad it adds a bunch of stuff I don't want, the same happens when I write char by char. Now when I ust the filewriter class to write a string at a time it works great, but I just overwrite the first line of the file each time. Any help/tips appreciated.
I agree. Here's the link: http://aspose.com/file-tools
subject: seeking and writing to a file
It's not a secret anymore!