Friday, February 8, 2002 05:30 AM
If you are using the same
(or whatever) without moving the file pointer, then you will just keep appending.
One option is to create a new
FileWriter for each time you want to write to the file. This will overwrite the file every time.
Another option is to use a
RandomAccessFile and set the file pointer (using
seek) to zero before writing your
I'm not sure why you would want to do what you are doing, but that's how to do it.