ByteBufferAllocator


@UnstableApi
public interface ByteBufferAllocator


A memory allocator for ByteBuffer.

Summary

Constants

default static final ByteBufferAllocator

Default implementation.

Public methods

abstract ByteBuffer
allocate(int capacity)

Allocates and returns a new ByteBuffer.

Constants

DEFAULT

default static final ByteBufferAllocator DEFAULT

Default implementation.

Public methods

allocate

abstract ByteBuffer allocate(int capacity)

Allocates and returns a new ByteBuffer.

Parameters
int capacity

The new buffer's capacity, in bytes.

Throws
java.lang.IllegalArgumentException

If the capacity is a negative integer.