ByteBufferPool

interface ByteBufferPool

A pool of byte buffers.

Buffers allow for more flexible memory management, and can be reused to reduce memory allocation overhead. Note, however, these pools are intended for the knio library. Once a buffer is released it is assumed to be no longer in use, and should not be used elsewhere because it may be reused elsewhere in the library.

Inheritors

Functions

Link copied to clipboard
abstract fun acquire(size: Int): ByteBuffer

Acquires a buffer of the specified size, allocating a new buffer if necessary. If a buffer exists equal to or greater than the specified size, within the block size, that buffer will be returned.

Link copied to clipboard
abstract fun release(buffer: ByteBuffer)

Releases the buffer back to the pool.