public class AtomicFileWriter
extends java.io.Writer
FileWriter that uses UTF-8.
The write operation is atomic when used for overwriting; it either leaves the original file intact, or it completely rewrites it with new contents.
| Constructor and Description |
|---|
AtomicFileWriter(java.io.File f) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
commit() |
void |
flush() |
java.io.File |
getTemporaryFile()
Until the data is committed, this file captures
the written content.
|
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(java.lang.String str,
int off,
int len) |
public AtomicFileWriter(java.io.File f)
throws java.io.IOException
java.io.IOExceptionpublic void write(int c)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOExceptionpublic void commit()
throws java.io.IOException
java.io.IOExceptionpublic java.io.File getTemporaryFile()
Copyright © 2013. All Rights Reserved.