All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlinx.io.core.BytePacketBuilderJVM.kt Maven / Gradle / Ivy

There is a newer version: 0.1.16
Show newest version
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