public class PacketWritestream extends Object implements WriteStream<Buffer>
WriteStream
for sending packets to a SocketAddress
.
The stream is called when the write fails.
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen.Constructor and Description |
---|
PacketWritestream(PacketWritestream delegate) |
Modifier and Type | Method and Description |
---|---|
PacketWritestream |
drainHandler(Handler<Void> handler)
Set a drain handler on the stream.
|
void |
end()
Ends the stream.
|
void |
end(Buffer t)
Same as
WriteStream.end() but writes some data to the stream before ending. |
PacketWritestream |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the write stream.
|
Object |
getDelegate() |
static PacketWritestream |
newInstance(PacketWritestream arg) |
PacketWritestream |
setWriteQueueMaxSize(int maxSize)
Set the maximum size of the write queue to
maxSize . |
PacketWritestream |
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newInstance
newInstance
public PacketWritestream(PacketWritestream delegate)
public Object getDelegate()
getDelegate
in interface StreamBase
getDelegate
in interface WriteStream<Buffer>
public void end()
Once the stream has ended, it cannot be used any more.
end
in interface WriteStream<Buffer>
public void end(Buffer t)
WriteStream.end()
but writes some data to the stream before ending.end
in interface WriteStream<Buffer>
t
- public boolean writeQueueFull()
true
if there are more bytes in the write queue than the value set using setWriteQueueMaxSize(int)
writeQueueFull
in interface WriteStream<Buffer>
public PacketWritestream exceptionHandler(Handler<Throwable> handler)
WriteStream
exceptionHandler
in interface StreamBase
exceptionHandler
in interface WriteStream<Buffer>
handler
- the exception handlerpublic PacketWritestream write(Buffer data)
WriteStream
WriteStream.writeQueueFull()
method before writing. This is done automatically if using a Pump
.write
in interface WriteStream<Buffer>
data
- the data to writepublic PacketWritestream setWriteQueueMaxSize(int maxSize)
WriteStream
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.setWriteQueueMaxSize
in interface WriteStream<Buffer>
maxSize
- the max size of the write streampublic PacketWritestream drainHandler(Handler<Void> handler)
WriteStream
Pump
for an example of this being used.drainHandler
in interface WriteStream<Buffer>
handler
- the handlerpublic static PacketWritestream newInstance(PacketWritestream arg)
Copyright © 2016. All rights reserved.