Package-level declarations
Types
Sequential (non-concurrent) byte channel implementation
Channel for asynchronous reading of sequences of bytes. This is a single-reader channel.
Channel for asynchronous writing of sequences of bytes. This is a single-writer channel.
Thrown when a coroutine awaiting I/O is replaced by another.
API marked with this annotation is internal, and it is not intended to be used outside Ktor. It could be modified or removed without any notice. Using it outside Ktor could cause undefined behaviour and/or any unexpected effects.
A marker annotations for DSLs.
API marked with this annotation is experimental and is not guaranteed to be stable.
API marked with this annotation is intended to become public in the future version. Usually it means that the API can't be public at the moment of development due to compatibility guarantees restrictions.
Properties
Functions
Ensures that when the given job is canceled, the ByteChannel is canceled with the same exception.
Creates a channel for reading from the specified byte array. Please note that it could use content directly or copy its bytes depending on the platform
Creates a channel for reading from the specified byte buffer.
Suspends the channel until it is exhausted or gets closed. If the read buffer is empty, it suspends until there are bytes available in the channel. Once the channel is exhausted or closed, this function returns.
Invokes consumer when it will be possible to read at least min bytes providing byte buffer to it so lambda can read from the buffer up to ByteBuffer.remaining bytes. If there are no min bytes available then the invocation could suspend until the requirement will be met.
Invokes block if it is possible to read at least min byte providing buffer to it so lambda can read from the buffer up to Buffer.readRemaining bytes. If there are no min bytes available then the invocation returns -1.
Reads all available bytes to dst buffer and returns immediately or suspends if no bytes available
Reads bytes from the channel and writes them to the buffer up to its limit. If the channel's read buffer is exhausted, it suspends until there are bytes available.
Reads all available bytes to dst buffer and returns immediately or suspends if no bytes available
Reads all length bytes to dst buffer or fails if channel has been closed. Suspends if not enough bytes available.
Reads a packet of packet bytes from the channel.
Reads a line of UTF-8 characters to the specified out buffer. It recognizes CR, LF and CRLF as a line delimiter.
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.
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.