This commit is contained in:
Syer10
2025-10-03 21:04:05 -04:00
parent 331acb966a
commit a7cc5e664b
41 changed files with 406 additions and 538 deletions

View File

@@ -22,16 +22,16 @@ actual suspend fun ByteReadChannel.toSource(context: CoroutineContext): Source {
channel.cancel()
}
override fun read(sink: Buffer, byteCount: Long): Long {
override fun read(
sink: Buffer,
byteCount: Long,
): Long {
val buffer = ByteArray(byteCount.toInt())
val read = runBlocking(context) { channel.readAvailable(buffer) }
sink.write(buffer.reversedArray())
return read.toLong()
}
override fun timeout(): Timeout {
return Timeout()
}
override fun timeout(): Timeout = Timeout()
}
}