ByteWriteChannel
Channel for asynchronous writing of sequences of bytes. This is a single-writer channel.
Operations on this channel cannot be invoked concurrently, unless explicitly specified otherwise in description. Exceptions are close and flush.
Inheritors
Channel for asynchronous writing of sequences of bytes. This is a single-writer channel.
Operations on this channel cannot be invoked concurrently, unless explicitly specified otherwise in description. Exceptions are close and flush.
Channel for asynchronous writing of sequences of bytes. This is a single-writer channel.
Operations on this channel cannot be invoked concurrently, unless explicitly specified otherwise in description. Exceptions are close and flush.
Properties
Returns true
if channel flushes automatically all pending bytes after every write function call. If false
then flush only happens at manual flush invocation or when the buffer is full.
Returns true
if channel flushes automatically all pending bytes after every write function call. If false
then flush only happens at manual flush invocation or when the buffer is full.
Returns true
if channel flushes automatically all pending bytes after every write function call. If false
then flush only happens at manual flush invocation or when the buffer is full.
Returns number of bytes that can be written without suspension. Write operations do no suspend and return immediately when this number is at least the number of bytes requested for write.
Returns number of bytes that can be written without suspension. Write operations do no suspend and return immediately when this number is at least the number of bytes requested for write.
Returns number of bytes that can be written without suspension. Write operations do no suspend and return immediately when this number is at least the number of bytes requested for write.
Returns number of bytes that can be written without suspension. Write operations do no suspend and return immediately when this number is at least the number of bytes requested for write.
A closure causes exception or null
if closed successfully or not yet closed
A closure causes exception or null
if closed successfully or not yet closed
A closure causes exception or null
if closed successfully or not yet closed
A closure causes exception or null
if closed successfully or not yet closed
Returns true
is channel has been closed and attempting to write to the channel will cause an exception.
Returns true
is channel has been closed and attempting to write to the channel will cause an exception.
Returns true
is channel has been closed and attempting to write to the channel will cause an exception.
Returns true
is channel has been closed and attempting to write to the channel will cause an exception.
Number of bytes written to the channel. It is not guaranteed to be atomic so could be updated in the middle of write operation.
Number of bytes written to the channel. It is not guaranteed to be atomic so could be updated in the middle of write operation.
Number of bytes written to the channel. It is not guaranteed to be atomic so could be updated in the middle of write operation.
Number of bytes written to the channel. It is not guaranteed to be atomic so could be updated in the middle of write operation.
Functions
Invokes block when at least 1 byte is available for write.
Closes this channel with no failure (successfully)
Flushes all pending write bytes making them available for read.
Flushes all pending write bytes making them available for read.
Flushes all pending write bytes making them available for read.
Flushes all pending write bytes making them available for read.
Create blocking java.io.OutputStream for this channel that does block every time the channel suspends at write Similar to do reading in runBlocking however you can pass it to regular blocking API
Invokes block when it will be possible to write at least min bytes providing byte buffer to it so lambda can write to the buffer up to ByteBuffer.remaining bytes. If there are no min bytes spaces available then the invocation could suspend until the requirement will be met.
Await for desiredSpace will be available for write and invoke block function providing Memory instance and the corresponding range suitable for wiring in the memory. The block function should return number of bytes were written, possibly 0.
Writes as much as possible and only suspends if buffer is full
Writes as much as possible and only suspends if buffer is full
Invokes block if it is possible to write at least min byte providing byte buffer to it so lambda can write to the buffer up to ByteBuffer.remaining bytes. If there are no min bytes spaces available then the invocation returns 0.
Writes as much as possible and only suspends if buffer is full
Writes as much as possible and only suspends if buffer is full
Invokes block if it is possible to write at least min byte providing buffer to it so lambda can write to the buffer up to Buffer.writeRemaining bytes. If there are no min bytes spaces available then the invocation returns -1.
Writes byte and suspends until written. Crashes if channel get closed while writing.
Writes byte and suspends until written. Crashes if channel get closed while writing.
Writes byte and suspends until written. Crashes if channel get closed while writing.
Writes UTF16 character
Writes double number and suspends until written. Crashes if channel get closed while writing.
Writes double number and suspends until written. Crashes if channel get closed while writing.
Writes double number and suspends until written. Crashes if channel get closed while writing.
Writes double number and suspends until written. Crashes if channel get closed while writing.
Writes float number and suspends until written. Crashes if channel get closed while writing.
Writes float number and suspends until written. Crashes if channel get closed while writing.
Writes float number and suspends until written. Crashes if channel get closed while writing.
Writes float number and suspends until written. Crashes if channel get closed while writing.
Writes int number and suspends until written. Crashes if channel get closed while writing.
Writes int number and suspends until written. Crashes if channel get closed while writing.
Writes int number and suspends until written. Crashes if channel get closed while writing.
Writes long number and suspends until written. Crashes if channel get closed while writing.
Writes long number and suspends until written. Crashes if channel get closed while writing.
Writes long number and suspends until written. Crashes if channel get closed while writing.
Writes short number and suspends until written. Crashes if channel get closed while writing.
Writes short number and suspends until written. Crashes if channel get closed while writing.
Writes short number and suspends until written. Crashes if channel get closed while writing.
Writes short number and suspends until written. Crashes if channel get closed while writing.
Invokes block for every free buffer until it return false
. It will also suspend every time when no free space available for write.