ByteReadChannel
Channel for asynchronous reading of sequences of bytes. This is a single-reader channel.
Operations on this channel cannot be invoked concurrently.
Inheritors
Properties
Functions
Converts the current ByteReadChannel instance into a RawSource. This enables the usage of a ByteReadChannel as a RawSource for reading operations.
Suspend the channel until it has min bytes or gets closed. Throws exception if the channel was closed with an error. If there are bytes available in the channel, this function returns immediately.
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.
Retrieves, but does not consume, up to the specified number of bytes from the current position in this ByteReadChannel.
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 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 a 32-bit floating-point value from the current ByteReadChannel.
Reads a 32-bit floating-point value from the current ByteReadChannel.
Reads data from the ByteReadChannel into the provided buffer until the buffer is fully filled or EOF is reached.
Reads a packet of packet bytes from the channel.
Reads bytes from the ByteReadChannel until a specified sequence of bytes is encountered or the specified limit is reached.
Reads a line of UTF-8 characters from the ByteReadChannel. It recognizes CR, LF and CRLF as line delimiters.
Reads a line of UTF-8 characters to the specified out buffer. It recognizes CR, LF and CRLF as a line delimiter.
Reads a line of UTF-8 characters to the specified out buffer. It recognizes the specified line ending as a line delimiter and throws an exception if an unexpected line delimiter is found. By default, all line endings (CR, LF and CRLF) are allowed as a line delimiter.
Skips the specified byteString in the ByteReadChannel if it is found at the current position.
Create blocking java.io.InputStream for this channel that does block every time the channel suspends at read Similar to do reading in runBlocking however you can pass it to regular blocking API