public class ResettableBufferedOutputStream extends 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(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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
boolean |
isResettable()
Returns true if buffer can be reset.
|
void |
reset()
Perform a buffer reset.
|
void |
write(byte[] bytes) |
void |
write(byte[] bytes,
int offset,
int length) |
void |
write(int b) |
public ResettableBufferedOutputStream(OutputStream output, int bufferSize)
output - The wrapped output stream .bufferSize - The buffer size.public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] bytes)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] bytes,
int offset,
int length)
throws IOException
write in class OutputStreamIOExceptionpublic void reset()
ResettableBufferreset in interface ResettableBufferpublic 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 boolean isResettable()
ResettableBufferisResettable in interface ResettableBuffertrue if buffer can be reset, otherwise false.Copyright © 2012–2016 OmniFaces. All rights reserved.