public abstract static class FlatBufferBuilder.ByteBufferFactory extends Object
The com.google.flatbuffers.FlatBufferBuilder class contains the HeapByteBufferFactory class to preserve the default behavior in the event that the user does not provide their own implementation of this interface.
| Constructor and Description |
|---|
ByteBufferFactory() |
| Modifier and Type | Method and Description |
|---|---|
abstract ByteBuffer |
newByteBuffer(int capacity)
Create a `ByteBuffer` with a given capacity.
|
void |
releaseByteBuffer(ByteBuffer bb)
Release a ByteBuffer.
|
public abstract ByteBuffer newByteBuffer(int capacity)
capacity - The size of the `ByteBuffer` to allocate.public void releaseByteBuffer(ByteBuffer bb)
FlatBufferBuilder released any reference to it, so it
is safe to dispose the buffer or return it to a pool. It is not guaranteed that the buffer
has been created with newByteBuffer(int).bb - the buffer to release