SuspendableReadSession

interface SuspendableReadSession : ReadSession

Functions

Link copied to clipboard
abstract suspend fun await(atLeast: Int = 1): Boolean

Suspend until atLeast bytes become available or end of stream encountered (possibly due to exceptional close)

Link copied to clipboard
abstract fun discard(n: Int): Int

Discard at most n available bytes or 0 if no bytes available yet

Link copied to clipboard
abstract fun request(atLeast: Int = 1): IoBuffer?

Request buffer range atLeast bytes length

Properties

Link copied to clipboard
abstract val availableForRead: Int

Number of bytes available for read. However it does not necessarily mean that all available bytes could be requested at once

Inheritors

Link copied to clipboard