static fun atomicReplace(path: Path!, bytes: ByteArray!): Unit
(source)
Write a temporary file and then replace target.
path
- Path!: The target file to be replaced (if it exists).
bytes
- ByteArray!: 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
- Path!: The target file to be replaced (if it exists).
fn
- IOConsumer<Writer!>!: 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
- Path!: The target file to be replaced (if it exists).
charset
- Charset!: The charset of the file.
fn
- IOConsumer<Writer!>!: A consumer that will be provided a buffered Writer
instance that will write to the file.