core-ktx / androidx.util / android.util.AtomicFile / tryWrite

tryWrite

inline fun AtomicFile.tryWrite(block: (out: FileOutputStream) -> Unit): Unit

Perform the write operations inside block on this file. If block throws an exception the write will be failed. Otherwise the write will be applied atomically to the file.