Channel Sequential JVM
Try to copy at least min but up to max bytes to the specified destination buffer from this input skipping offset bytes. If there are not enough bytes available to provide min bytes after skipping offset bytes then it will trigger the underlying source reading first and after that will simply copy available bytes even if EOF encountered so min is not a requirement but a desired number of bytes. It is safe to specify max greater than the destination free space.
min shouldn't be bigger than the destination free space. This function could trigger the underlying source suspending reading. It is allowed to specify too big offset so in this case this function will always return
0 after prefetching all underlying bytes but note that it may lead to significant memory consumption. This function usually copy more bytes than min (unless
max = min) but it is not guaranteed. When
0 is returned with
offset = 0 then it makes sense to check endOfInput.
Invokes block if it is possible to read at least min byte providing byte buffer to it so lambda can read from the buffer up to ByteBuffer.available bytes. If there are no min bytes available then the invocation returns 0.
Reads all available bytes to dst buffer and returns immediately or suspends if no bytes available
Reads the specified amount of bytes and makes a byte packet from them. Fails if channel has been closed and not enough bytes available. Accepts headerSizeHint to be provided, see WritePacket.
Invokes block if it is possible to write at least min byte providing byte buffer to it so lambda can write to the buffer up to ByteBuffer.remaining bytes. If there are no min bytes spaces available then the invocation returns 0.
Writes as much as possible and only suspends if buffer is full