public FileInputStream openRead() throws FileNotFoundException {
  if (mBackupName.exists()) {
    mBaseName.delete();
    mBackupName.renameTo(mBaseName);
  }
  return new FileInputStream(mBaseName);
}

public FileInputStream openRead ( ) throws FileNotFoundException { if ( mBackupName . exists ( ) ) { mBaseName . delete ( ) ; mBackupName . renameTo ( mBaseName ) ; } return new FileInputStream ( mBaseName ) ; }
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 .
