readBytes

fun Buffer.readBytes(count: Int = size.toInt()): ByteArray

Read the specified number of bytes specified (optional, read all remaining by default)


fun Source.readBytes(): ByteArray

Deprecated

Use readByteArray instead

Replace with

import kotlinx.io.readByteArray
this.readByteArray()

Read exactly n bytes (consumes all remaining if n is not specified but up to Int.MAX_VALUE bytes). Does fail if not enough bytes remaining.


fun Source.readBytes(count: Int): ByteArray

Deprecated

Use readByteArray instead

Replace with

this.readByteArray(count)