So I'm writing the file writing part of a program now. I'm doing some research, and I can't find a good way of writing to the file.
I need to write to different lines in the file, not always at the end, which is what most examples are.
The current/temporary plan is to read the whole file into a hashmap, and then update the hashmap, and when the person is done tagging, rewrite the database file from the hashmap.
I'm suuure there is a better solution, and I'll keep looking. Just wondering if anyone knew of a way to write to certain lines using some sort of writer.
(Basically, I have a file containing a lot of data. I need to append data onto different lines, depending on the data. I'm not sure how to tell any of the writer objects to write on line x.)
I need to write to different lines in the file, not always at the end, which is what most examples are.
The current/temporary plan is to read the whole file into a hashmap, and then update the hashmap, and when the person is done tagging, rewrite the database file from the hashmap.
I'm suuure there is a better solution, and I'll keep looking. Just wondering if anyone knew of a way to write to certain lines using some sort of writer.
(Basically, I have a file containing a lot of data. I need to append data onto different lines, depending on the data. I'm not sure how to tell any of the writer objects to write on line x.)