AtomicFile

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.

Constructors

public AtomicFile(File baseName) source

Methods

public File getBaseFile() source
public void delete() source
public boolean exists() source
public FileOutputStream startWrite() throws IOException source
public void finishWrite(FileOutputStream str) source
public void failWrite(FileOutputStream str) source
public FileInputStream openRead() throws FileNotFoundException source
public long getLastModifiedTime() source
public byte[] readFully() throws IOException source
public String toString() source

Made 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.