readNext

suspend fun readNext(): T

Suspends and waits for the next piece of data.

Return

the next available piece of data.

Throws

when the stream is closed normally and no more data is available.

when the stream is closed abnormally.