kotlinx.io.streams.ByteArrays.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlinx-io-jvm Show documentation
Show all versions of kotlinx-io-jvm Show documentation
IO support libraries for Kotlin
package kotlinx.io.streams
import kotlinx.io.pool.*
internal val ByteArrayPool = object : DefaultPool(128) {
final override fun produceInstance(): ByteArray {
return ByteArray(4096)
}
final override fun validateInstance(instance: ByteArray) {
require(instance.size == 4096) { "Unable to recycle buffer of wrong size: ${instance.size} != 4096" }
super.validateInstance(instance)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy