I need to find a way to take the end off of a file. The file has an end marker that will prevent my program from reading past it. In short, I need to take the end off a file, and replace it with a new string.
This would move the EoF to the end (again).
[Exception Trap begin]
Open a BufferedReader to the original file.
Open a BufferedWriter to a temporary file.
Loop through each line of the file testing for the custom end of file marker.
If not found, write the line to the temp file.
If found, write the NEW CONTENT to the temp file and write custom EOF in temp file.
Close the temp file.
Close the original file.
Delete original file.
Rename temp file to original file name.
[Exception Trap end]