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 OutputStream
IOException
public void write(byte[] bytes) throws IOException
write
in class OutputStream
IOException
public void write(byte[] bytes, int offset, int length) throws IOException
write
in class OutputStream
IOException
public void reset()
ResettableBuffer
reset
in interface ResettableBuffer
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public boolean isResettable()
ResettableBuffer
isResettable
in interface ResettableBuffer
true
if buffer can be reset, otherwise false
.Copyright © 2012–2015 OmniFaces. All rights reserved.