fun AtomicFile.readBytes(): ByteArray
Gets the entire content of this file as a byte array. |
|
fun AtomicFile.readText(charset: Charset = Charsets.UTF_8): String
Gets the entire content of this file as a String using UTF-8 or specified charset. |
|
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. |
|
fun AtomicFile.writeBytes(array: ByteArray): Unit
Sets the content of this file as an array of bytes. |
|
fun AtomicFile.writeText(text: String, charset: Charset = Charsets.UTF_8): Unit
Sets the content of this file as text encoded using UTF-8 or specified charset. If this file exists, it becomes overwritten. |