class MutableData
Mutable concurrently accessible data buffer. Could be accessed from several workers simulteniously.
Mutable concurrently accessible data buffer. Could be accessed from several workers simulteniously.
MutableData(capacity: Int = 16)
Current data size, may concurrently change later on.
val size: Int
Appends data to the buffer.
fun append(data: MutableData)
Appends byte array to the buffer.
fun append( data: ByteArray, fromIndex: Int = 0, toIndex: Int = data.size)
Appends C data to the buffer, if data
is null or count
is non-positive - return.
fun append(data: COpaquePointer?, count: Int)
Copies range of mutable data to the byte array.
fun copyInto( output: ByteArray, destinationIndex: Int, startIndex: Int, endIndex: Int)
Get a byte from the mutable data.
operator fun get(index: Int): Byte
Reset the data buffer, makings its size 0.
fun reset()
Executes provided block under lock with the raw data buffer. Block is executed under the spinlock, and must be short.
fun <R> withBufferLocked( block: (array: ByteArray, dataSize: Int) -> R ): R
Executes provided block under lock with raw pointer to the data stored in the buffer. Block is executed under the spinlock, and must be short.
fun <R> withPointerLocked( block: (COpaquePointer, dataSize: Int) -> R ): R
© 2010–2019 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-mutable-data/index.html