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 Writer
IOException
public void reset()
ResettableBuffer
reset
in interface ResettableBuffer
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
public boolean isResettable()
ResettableBuffer
isResettable
in interface ResettableBuffer
true
if buffer can be reset, otherwise false
.Copyright © 2012–2016 OmniFaces. All rights reserved.