RecyclingByteBlockAllocator

A ByteBlockPool.Allocator implementation that recycles unused byte blocks in a buffer and reuses them in subsequent calls to .byteBlock.

Note: This class is not thread-safe

Constructors

Link copied to clipboard
constructor(maxBufferedBlocks: Int, bytesUsed: Counter)
constructor(maxBufferedBlocks: Int)
constructor()

Creates a new RecyclingByteBlockAllocator with a block size of , upper buffered docs limit of (DEFAULT_BUFFERED_BLOCKS).

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val byteBlock: ByteArray

Functions

Link copied to clipboard
Link copied to clipboard
fun freeBlocks(num: Int): Int

Removes the given number of byte blocks from the buffer if possible.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun recycleByteBlocks(blocks: Array<ByteArray?>, start: Int, end: Int)