await

open suspend fun await(atLeast: Int): Boolean

Overrides SuspendableReadSession.await

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

Exceptions

Throwable - if the channel has been closed with an exception or cancelled

IllegalArgumentException - if atLeast is negative to too big (usually bigger that 4088)

Return true if there are atLeast bytes available or false if end of stream encountered (there still could be bytes available but less than atLeast)