request

open override fun request(atLeast: Int): ChunkBuffer?

Request buffer range atLeast bytes length

There are the following reasons for this function to return null:

  • not enough bytes available yet (should be at least atLeast bytes available)

  • due to buffer fragmentation it is impossible to represent the requested range as a single buffer range

  • end of stream encountered and all bytes were consumed

Return

buffer for the requested range or null if it is impossible to provide such a buffer view

Throws

if the channel has been closed with an exception or cancelled