public class ResettableBufferedWriter extends Writer 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().
ResettableBufferedOutputStream| Constructor and Description |
|---|
ResettableBufferedWriter(Writer writer,
int bufferSize,
String characterEncoding)
Construct a new resettable buffered writer which wraps the given writer and forcibly buffers everything until
the given buffer size in bytes, 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(char[] chars,
int offset,
int length) |
public ResettableBufferedWriter(Writer writer, int bufferSize, String characterEncoding)
writer - The wrapped writer.bufferSize - The buffer size.characterEncoding - The character encoding.public void write(char[] chars,
int offset,
int length)
throws IOException
write in class WriterIOExceptionpublic void reset()
ResettableBufferreset in interface ResettableBufferpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic boolean isResettable()
ResettableBufferisResettable in interface ResettableBuffertrue if buffer can be reset, otherwise false.Copyright © 2012–2021 OmniFaces. All rights reserved.