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.OutputStreamjava.io.IOExceptionpublic void write(byte[] bytes)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] bytes,
int offset,
int length)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void reset()
ResettableBufferreset in interface ResettableBufferpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic boolean isResettable()
ResettableBufferisResettable in interface ResettableBuffertrue if buffer can be reset, otherwise false.