static fun atomicReplace(path: Path, bytes: ByteArray): Unit
(source)
Write a temporary file and then replace target.
path
- The target file to be replaced (if it exists).
bytes
- The bytes to be written.
IOException
- If an I/O error occurs.
static fun atomicReplace(path: Path, fn: IOConsumer<Writer>): Unit
(source)
Write a temporary file and then replace target.
path
- The target file to be replaced (if it exists).
fn
- A consumer that will be provided a buffered Writer instance that will write to the file.
IOException
- If an I/O error occurs.
static fun atomicReplace(path: Path, charset: Charset, fn: IOConsumer<Writer>): Unit
(source)
Write a temporary file and then replace target.
path
- The target file to be replaced (if it exists).
charset
- The charset of the file.
fn
- A consumer that will be provided a buffered Writer instance that will write to the file.