- All Known Implementing Classes:
SmartSocketWriter
,SocketWriter
public interface DataWriter
Write data to the underlying transport (most likely a socket).
Do not combine
write(io.helidon.common.buffers.BufferData)
and writeNow(io.helidon.common.buffers.BufferData)
to a single underlying transport, unless you can guarantee there will not be a race between these two methods.-
Method Summary
Modifier and TypeMethodDescriptionvoid
write
(BufferData buffer) Write buffer, may delay writing and may write on a different thread.void
write
(BufferData... buffers) Write buffers, may delay writing and may write on a different thread.void
writeNow
(BufferData buffer) Write buffer to underlying transport blocking until the buffer is written.void
writeNow
(BufferData... buffers) Write buffers to underlying transport blocking until the buffers are written.
-
Method Details
-
write
Write buffers, may delay writing and may write on a different thread. This method also may combine multiple calls into a single write to the underlying transport.- Parameters:
buffers
- buffers to write
-
write
Write buffer, may delay writing and may write on a different thread. This method also may combine multiple calls into a single write to the underlying transport.- Parameters:
buffer
- buffer to write
-
writeNow
Write buffers to underlying transport blocking until the buffers are written.- Parameters:
buffers
- buffers to write
-
writeNow
Write buffer to underlying transport blocking until the buffer is written.- Parameters:
buffer
- buffer to write
-