FlatBuffers
An open source project by FPL.
|
An interface that provides a user of the FlatBufferBuilder class the ability to specify the method in which the internal buffer gets allocated. More...
An interface that provides a user of the FlatBufferBuilder class the ability to specify the method in which the internal buffer gets allocated.
This allows for alternatives to the default behavior, which is to allocate memory for a new byte-array backed ByteBuffer
array inside the JVM.
The 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.
Public Member Functions | |
ByteBuffer | newByteBuffer (int capacity) |
Create a ByteBuffer with a given capacity. More... | |
default void | releaseByteBuffer (ByteBuffer bb) |
Release a ByteBuffer. More... | |
ByteBuffer com.google.flatbuffers.FlatBufferBuilder.ByteBufferFactory.newByteBuffer | ( | int | capacity | ) |
Create a ByteBuffer
with a given capacity.
capacity | The size of the ByteBuffer to allocate. |
ByteBuffer
that was allocated. Implemented in com.google.flatbuffers.FlatBufferBuilder.HeapByteBufferFactory.
|
inline |
Release a ByteBuffer.
Current 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 |