public class ResettableBufferedOutputStream extends java.io.OutputStream implements ResettableBuffer
There is a reset()
method which enables the developer to reset the buffer, as long as it's not flushed yet,
which can be determined by isResettable()
.
ResettableBufferedWriter
Constructor and Description |
---|
ResettableBufferedOutputStream(java.io.OutputStream output,
int bufferSize)
Construct a new resettable buffered output stream which wraps the given output stream and forcibly buffers
everything until the given buffer size, regardless of flush calls.
|
public ResettableBufferedOutputStream(java.io.OutputStream output, int bufferSize)
output
- The wrapped output stream .bufferSize
- The buffer size.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] bytes) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] bytes, int offset, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void reset()
ResettableBuffer
reset
in interface ResettableBuffer
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public boolean isResettable()
ResettableBuffer
isResettable
in interface ResettableBuffer
true
if buffer can be reset, otherwise false
.