FlatBufferBuilder
Class that helps you build a FlatBuffer. See the section "Use in Java/C#" in the main FlatBuffers documentation.
Constructors
Link copied to clipboard
Start with a buffer of size `initial_size`, then grow as required.
constructor(initial_size: Int, bb_factory: FlatBufferBuilder.ByteBufferFactory, existing_bb: ByteBuffer, utf8: Utf8)
Start with a buffer of size `initial_size`, then grow as required.
Start with a buffer of size `initial_size`, then grow as required.
constructor()
Start with a buffer of 1KiB, then grow as required.
Alternative constructor allowing reuse of ByteBuffers.
Alternative constructor allowing reuse of ByteBuffers.
Types
Functions
Link copied to clipboard
Add a `boolean` to the buffer, properly aligned, and grows the buffer (if necessary).
Add a `boolean` to a table at `o` into its vtable, with value `x` and default `d`.
Link copied to clipboard
Create a byte array in the buffer.
Link copied to clipboard
Link copied to clipboard
Encode the string `s` in the buffer using UTF-8.
Create a string in the buffer from an already encoded UTF-8 string in a ByteBuffer.
Link copied to clipboard
Create a new array/vector and return a ByteBuffer to be filled later.
Link copied to clipboard
Create a vector of tables.
Link copied to clipboard
Get the ByteBuffer representing the FlatBuffer.
Link copied to clipboard
Finalize a buffer, pointing to the given `root_table`, with the size prefixed.
Link copied to clipboard
In order to save space, fields that are set to their default value don't get serialized into the buffer.
Link copied to clipboard
open fun init(existing_bb: ByteBuffer, bb_factory: FlatBufferBuilder.ByteBufferFactory): FlatBufferBuilder
Alternative initializer that allows reusing this object on an existing `ByteBuffer`.
Link copied to clipboard
Helper function to test if a field is present in the table
Link copied to clipboard
Add a `boolean` to the buffer, backwards from the current location.
Link copied to clipboard
A utility function to copy and return the ByteBuffer data as a `byte[]`.
A utility function to copy and return the ByteBuffer data from `start` to `start` + `length` as a `byte[]`.
Link copied to clipboard
A utility function to return an InputStream to the ByteBuffer data
Link copied to clipboard
Start encoding a new object in the buffer.
Link copied to clipboard
Start a new array/vector of objects.