public interface DrainSupport<T>
Handler
which is notified once the write queue is drained again.
This way you can stop writing once the write queue consumes to much memory and so prevent
an OutOfMemoryError.Modifier and Type | Method and Description |
---|---|
T |
drainHandler(Handler<java.lang.Void> handler)
Set a drain handler on the stream.
|
T |
setWriteQueueMaxSize(int maxSize)
Set the maximum size of the write queue to
maxSize . |
boolean |
writeQueueFull()
This will return
true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int) |
T setWriteQueueMaxSize(int maxSize)
maxSize
. You will still be able to write to the stream even
if there is more than maxSize
bytes in the write queue. This is used as an indicator by classes such as
Pump
to provide flow control.boolean writeQueueFull()
true
if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int)