|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream org.omnifaces.io.ResettableBufferedOutputStream
public class ResettableBufferedOutputStream
This resettable buffered output stream will buffer everything until the given buffer size, regardless of flush calls. Only when the buffer size is exceeded, or when close is called, then the buffer will be actually flushed.
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
boolean |
isResettable()
Returns true if buffer can be resetted. |
void |
reset()
Perform a buffer reset. |
void |
write(byte[] bytes)
|
void |
write(byte[] bytes,
int offset,
int length)
|
void |
write(int b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResettableBufferedOutputStream(java.io.OutputStream output, int bufferSize)
output
- The wrapped output stream .bufferSize
- The buffer size.Method Detail |
---|
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] bytes) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] bytes, int offset, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void reset()
ResettableBuffer
reset
in interface ResettableBuffer
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public boolean isResettable()
ResettableBuffer
isResettable
in interface ResettableBuffer
true
if buffer can be resetted, otherwise false
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |