public class ReopenableFileOutputStream extends OutputStream
OutputStream that writes to a file.
Unlike regular FileOutputStream, this implementation allows the caller to close,
and then keep writing.
| Constructor and Description |
|---|
ReopenableFileOutputStream(File out) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
rewind()
In addition to close, ensure that the next "open" would truncate the file.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
protected final File out
public ReopenableFileOutputStream(File out)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void rewind()
throws IOException
IOExceptionCopyright © 2019. All rights reserved.