If an error is thrown inside the encryption routine (e.g. stream issues) and the program terminates as a result, all text in the file, including text that was already stored before starting the program, is destroyed because the write operation can not finish.
If an error is thrown inside the encryption routine (e.g. stream issues) and the program terminates as a result, all text in the file, including text that was already stored before starting the program, is destroyed because the write operation can not finish.