@@ -254,12 +254,11 @@ public object UnsafeBufferOperations {
254
254
public inline fun writeToTail (
255
255
buffer : Buffer ,
256
256
minimumCapacity : Int ,
257
- writeAction : (SegmentWriteContext , Segment ) -> Int
257
+ writeAction : (context: SegmentWriteContext , tail: Segment ) -> Int
258
258
): Int {
259
259
contract {
260
260
callsInPlace(writeAction, EXACTLY_ONCE )
261
261
}
262
-
263
262
val tail = buffer.writableSegment(minimumCapacity)
264
263
val bytesWritten = writeAction(SegmentWriteContextImpl , tail)
265
264
@@ -304,7 +303,10 @@ public object UnsafeBufferOperations {
304
303
* @sample kotlinx.io.samples.unsafe.UnsafeReadWriteSamplesJvm.messageDigest
305
304
* @sample kotlinx.io.samples.unsafe.UnsafeBufferOperationsSamples.crc32Unsafe
306
305
*/
307
- public inline fun iterate (buffer : Buffer , iterationAction : (BufferIterationContext , Segment ? ) -> Unit ) {
306
+ public inline fun iterate (
307
+ buffer : Buffer ,
308
+ iterationAction : (context: BufferIterationContext , head: Segment ? ) -> Unit
309
+ ) {
308
310
contract {
309
311
callsInPlace(iterationAction, EXACTLY_ONCE )
310
312
}
@@ -335,7 +337,7 @@ public object UnsafeBufferOperations {
335
337
*/
336
338
public inline fun iterate (
337
339
buffer : Buffer , offset : Long ,
338
- iterationAction : (BufferIterationContext , Segment ? , Long ) -> Unit
340
+ iterationAction : (context: BufferIterationContext , segment: Segment ? , startOfTheSegmentOffset: Long ) -> Unit
339
341
) {
340
342
contract {
341
343
callsInPlace(iterationAction, EXACTLY_ONCE )
@@ -393,7 +395,10 @@ public interface SegmentReadContext {
393
395
@UnsafeIoApi
394
396
@JvmSynthetic
395
397
@OptIn(ExperimentalContracts ::class )
396
- public inline fun SegmentReadContext.withData (segment : Segment , readAction : (ByteArray , Int , Int ) -> Unit ) {
398
+ public inline fun SegmentReadContext.withData (
399
+ segment : Segment ,
400
+ readAction : (bytes: ByteArray , startIndexInclusive: Int , endIndexExclusive: Int ) -> Unit
401
+ ) {
397
402
contract {
398
403
callsInPlace(readAction, EXACTLY_ONCE )
399
404
}
0 commit comments