asByteBuffer

fun Flow<ByteArray>.asByteBuffer(): Flow<ByteBuffer>

Converts the Flow of ByteArray to a Flow of ByteBuffer.

Return

A new Flow of ByteBuffer converted from the original Flow of ByteArray.


fun Flow<String>.asByteBuffer(charset: Charset = Charset.defaultCharset()): Flow<ByteBuffer>

Converts the Flow of String to a Flow of ByteBuffer using the specified charset.

Return

A new Flow of ByteBuffer converted from the original Flow of String.

Parameters

charset

The Charset to use for converting the strings to byte buffers. Defaults to the system's default charset.