- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
SmartSocketWriter,SocketWriter
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 TypeMethodDescriptiondefault voidclose()Closes this writer and frees any associated resources.default voidflush()Flushes to the underlying transport any pending data that has been written using eitherwrite(BufferData)orwrite(BufferData...).voidwrite(BufferData buffer) Write buffer, may delay writing and may write on a different thread.voidwrite(BufferData... buffers) Write buffers, may delay writing and may write on a different thread.voidwriteNow(BufferData buffer) Write buffer to underlying transport blocking until the buffer is written.voidwriteNow(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
-
flush
default void flush()Flushes to the underlying transport any pending data that has been written using eitherwrite(BufferData)orwrite(BufferData...). -
close
default void close()Closes this writer and frees any associated resources. Defaults to just a call toflush().- Specified by:
closein interfaceAutoCloseable
-