readByteArray

abstract fun readByteArray(scope: CoroutineScope, count: Int): Deferred<ByteArray>

异步读取并返回一个包含确切 count 字节的字节数组。

Return

一个 Deferred 对象,其未来结果是包含所读取字节的 ByteArray

Parameters

scope

执行异步读取操作的协程作用域。

count

要读取的字节数。

Throws

EOFException

如果在读取 count 个字节之前通道已关闭。