asByteArray

fun Flow<Byte>.asByteArray(groupStrategy: GroupStrategy = GroupStrategy.Count(8)): Flow<ByteArray>

Converts the Flow of Byte to a Flow of ByteArray.

Return

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

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

Converts the Flow of ByteBuffer to a Flow of ByteArray.

Return

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


fun Flow<String>.asByteArray(charset: Charset = Charset.defaultCharset()): Flow<ByteArray>

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

Return

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

Parameters

charset

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