You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require (size <= rem) { "size $size is greater than buffer's remaining capacity $rem" }
280
+
val buffer = writeDuplicated(rem)
281
+
val positionBefore = buffer.position()
282
+
block(buffer)
283
+
val delta = buffer.position() - positionBefore
284
+
if (delta <0|| delta > rem) throwIllegalStateException("Wrong buffer position change: $delta (position should be moved forward only by at most size bytes (size = $size)")
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io/packet/ByteWritePacketImpl.kt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,12 @@ internal class ByteWritePacketImpl(private var headerSizeHint: Int, private val
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-io/src/test/kotlin/kotlinx/coroutines/experimental/io/BytePacketReaderWriterTest.kt
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -433,5 +433,16 @@ class BytePacketReaderWriterTest {
0 commit comments