acquire

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.

Acquired buffers are removed from the pool. To reuse a buffer, it must be released back to the pool.

Return

The buffer acquired.

Parameters

size

The size of the buffer to acquire.