We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7510117 commit 754a19bCopy full SHA for 754a19b
core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io/ByteBufferChannel.kt
@@ -949,9 +949,10 @@ internal class ByteBufferChannel(
949
written = 0
950
writing {
951
val size = minOf(remaining(), node.readRemaining)
952
- if (!it.tryWriteExact(size)) throw IllegalStateException()
953
- written = node.read(this, size)
954
- bytesWritten(it, size)
+ if (it.tryWriteExact(size)) {
+ written = node.read(this, size)
+ bytesWritten(it, size)
955
+ }
956
}
957
} catch (t: Throwable) {
958
node.release()
0 commit comments