Sounds like you might be coming a mainframe background where "random access" files were the norm.
Java's model of a file is just like the UNIX one: it's a sequence of bytes, nothing more, nothing less. The only way to delete a line from a file is to copy the file to new file, leaving out that line, deleting the original file, and renaming to new file to the old name.