ByteBufferRecycler

class ByteBufferRecycler(delegate: (Int) -> ByteBuffer)

An implementation of a ByteBuffer allocation and recycling policy. The blocks are recycled if exactly the same size is requested, otherwise they're released to be GCed.

Constructors

Link copied to clipboard
constructor(delegate: (Int) -> ByteBuffer)

Functions

Link copied to clipboard
fun allocate(size: Int): ByteBuffer
Link copied to clipboard
fun reuse(buffer: ByteBuffer)