public class RewindableFileOutputStream extends OutputStream
OutputStream
that writes to a file.
Allows the caller to rewind the stream and override previous content with fresh new data.
Constructor and Description |
---|
RewindableFileOutputStream(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 RewindableFileOutputStream(File out)
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void rewind() throws IOException
IOException
Copyright © 2004–2021. All rights reserved.