ByteBufferPool
class ByteBufferPool : DefaultPool<ByteBuffer>
Constructors
Properties
val bufferSize: Int |
Inherited Properties
val capacity: Int Pool capacity. |
Functions
fun clearInstance(instance: ByteBuffer): ByteBuffer |
|
fun produceInstance(): ByteBuffer |
|
fun validateInstance(instance: ByteBuffer): Unit |
Inherited Functions
fun borrow(): T borrow an instance. Pool can recycle an old instance or create a new one |
|
fun dispose(): Unit Dispose the whole pool. None of borrowed objects could be used after the pool gets disposed otherwise it can result in undefined behaviour |
|
Dispose instance and release it’s resources |
|
Recycle an instance. Should be recycled what was borrowed before otherwise could fail |
Extension Functions
Borrows and instance of T from the pool, invokes block with it and finally recycles it |
|
Borrows and instance of T from the pool, invokes block with it and finally recycles it |