Class of android.util · AtomicFile.java · Android's reference
public class AtomicFile
A file that changes all at once: a write goes to "<name>.new", and finishWrite renames it over the base file. A reader sees the old file or the new one, never part of a write. A "<name>.bak" from the older scheme becomes the base file again.
public AtomicFile(File baseName) sourcepublic File getBaseFile() sourcepublic void delete() sourcepublic boolean exists() sourcepublic FileOutputStream startWrite() throws IOException sourcepublic void finishWrite(FileOutputStream str) sourcepublic void failWrite(FileOutputStream str) sourcepublic FileInputStream openRead() throws FileNotFoundException sourcepublic long getLastModifiedTime() sourcepublic byte[] readFully() throws IOException sourcepublic String toString() sourceMade from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.