kotlinx.io.core.BytePacketBuilderJVM.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.core
import kotlinx.io.pool.*
import java.nio.*
actual abstract class BytePacketBuilderPlatformBase
internal actual constructor(pool: ObjectPool) : BytePacketBuilderBase(pool) {
override fun writeFully(bb: ByteBuffer) {
val l = bb.limit()
writeWhile { chunk ->
val size = minOf(bb.remaining(), chunk.writeRemaining)
bb.limit(bb.position() + size)
chunk.writeFully(bb)
bb.limit(l)
bb.hasRemaining()
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy