ByteBufferPool

class ByteBufferPool(capacity: Int, bufferSize: Int) : DefaultPool<ByteBuffer>

Functions

Link copied to clipboard
actual override fun borrow(): ByteBuffer

borrow an instance. Pool can recycle an old instance or create a new one

Link copied to clipboard
open override fun close()

Does pool dispose

Link copied to clipboard
actual override fun dispose()

Dispose the whole pool. None of borrowed objects could be used after the pool gets disposed otherwise it can result in undefined behaviour

Link copied to clipboard
actual override fun recycle(instance: ByteBuffer)

Recycle an instance. Should be recycled what was borrowed before otherwise could fail

Properties

Link copied to clipboard
val bufferSize: Int
Link copied to clipboard
actual override val capacity: Int

Pool capacity