public class PreemptiveSafeFileOutputStream
extends java.io.OutputStream
A somewhat weaker version of SafeFileOutputStream suitable for writing huge files whose content can't fit into memory.
Relies entirely on StandardCopyOption.ATOMIC_MOVE guarantees; always recreates the target file.
The class is not thread-safe; expected to be used within try-with-resources or an equivalent statement.
| Constructor and Description |
|---|
PreemptiveSafeFileOutputStream(java.nio.file.Path target) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
close() |
void |
flush() |
void |
write(byte [] b,
int off,
int len) |
void |
write(int b) |
public PreemptiveSafeFileOutputStream(java.nio.file.Path target)
throws java.io.IOException
java.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte [] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void abort()
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOException