ANSWERS: 2
  • If the filesizes are small enough, it'b be easiest to read in the entire file as a string, truncate the file, and then write what you want to it.
  • Sure... only write them if the file is empty or doesn't exist. That or, extend the FileOutputStream to create a version that ignores the first three lines. (Doesn't seem like the best approach... as you only want them ignored if the file isn't already empty or non-existent.)

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy