public interface WriteStream<T> extends ExceptionSupport<T>
Any class that implements this interface can be used by a Pump to pump data from a ReadStream
to it.
This interface exposes a fluent api and the type T represents the type of the object that implements the interface to allow method chaining
| 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. |
T |
write(Buffer data)
Write some data to the stream.
|
boolean |
writeQueueFull()
This will return
true if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int) |
exceptionHandlerT write(Buffer data)
writeQueueFull() method before writing. This is done automatically if using a Pump.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)