question: public FileInputStream openRead ( ) throws FileNotFoundException { if ( mBackupName . exists ( ) ) { mBaseName . delete ( ) ; mBackupName . renameTo ( mBaseName ) ; } return new FileInputStream ( mBaseName ) ; }
target:  Open the atomic file for reading.  If there previously was an incomplete write, this will roll back to the last good data before opening for read.  You should call close() on the FileInputStream when you are done reading from it. <p>Note that if another thread is currently performing a write, this will incorrectly consider it to be in the state of a bad write and roll back, causing the new data currently being written to be dropped.  You must do your own threading protection for access to AtomicFile.