@@ -220,7 +220,7 @@ public object UnsafeBufferOperations {
220
220
public inline fun writeToTail (
221
221
buffer : Buffer ,
222
222
minimumCapacity : Int ,
223
- writeAction : (SegmentWriteContext , Segment ) -> Int
223
+ writeAction : (context: SegmentWriteContext , tail: Segment ) -> Int
224
224
) {
225
225
val tail = buffer.writableSegment(minimumCapacity)
226
226
val bytesWritten = writeAction(SegmentWriteContextImpl , tail)
@@ -265,7 +265,10 @@ public object UnsafeBufferOperations {
265
265
* @sample kotlinx.io.samples.unsafe.UnsafeReadWriteSamplesJvm.messageDigest
266
266
* @sample kotlinx.io.samples.unsafe.UnsafeBufferOperationsSamples.crc32Unsafe
267
267
*/
268
- public inline fun iterate (buffer : Buffer , iterationAction : (BufferIterationContext , Segment ? ) -> Unit ) {
268
+ public inline fun iterate (
269
+ buffer : Buffer ,
270
+ iterationAction : (context: BufferIterationContext , head: Segment ? ) -> Unit
271
+ ) {
269
272
iterationAction(BufferIterationContextImpl , buffer.head)
270
273
}
271
274
@@ -293,7 +296,7 @@ public object UnsafeBufferOperations {
293
296
*/
294
297
public inline fun iterate (
295
298
buffer : Buffer , offset : Long ,
296
- iterationAction : (BufferIterationContext , Segment ? , Long ) -> Unit
299
+ iterationAction : (context: BufferIterationContext , segment: Segment ? , startOfTheSegmentOffset: Long ) -> Unit
297
300
) {
298
301
require(offset >= 0 ) { " Offset must be non-negative: $offset " }
299
302
if (offset >= buffer.size) {
@@ -346,7 +349,10 @@ public interface SegmentReadContext {
346
349
*/
347
350
@UnsafeIoApi
348
351
@JvmSynthetic
349
- public inline fun SegmentReadContext.withData (segment : Segment , readAction : (ByteArray , Int , Int ) -> Unit ) {
352
+ public inline fun SegmentReadContext.withData (
353
+ segment : Segment ,
354
+ readAction : (bytes: ByteArray , startIndexInclusive: Int , endIndexExclusive: Int ) -> Unit
355
+ ) {
350
356
readAction(segment.dataAsByteArray(true ), segment.pos, segment.limit)
351
357
}
352
358
0 commit comments