asSource

fun ReadableByteChannel.asSource(): RawSource

Converts a ReadableByteChannel into a RawSource.

This extension function wraps the given ReadableByteChannel into a RawSource, enabling efficient reading of bytes from the channel as a source of data.

Return

a RawSource representation of the ReadableByteChannel.