Kotlin: Stream.awaitReadSome()
DESCRIPTION
Read some bytes from a stream.
This function is meant to be used in a Kotlin coroutine to suspend execution until the bytes have been read or an error occurs.
DECLARATION
suspend fun Stream.awaitReadSome(): ByteArray
THROWS EXCEPTIONS
NabtoRuntimeException:
- With error code
STOPPED
if the stream was stopped. NabtoRuntimeException:
- With error code
OPERATION_IN_PROGRESS
if another read is in progress. NabtoEOFException:
- if eof is reached
RETURNS
A byte array that was read from the stream.