Responsible for building up and accessing a FlatBuffer formatted byte array (via ByteBuffer).
FlatBufferBuilder
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 1 | Create a FlatBufferBuilder with a given initial size. |
| Clear | 1 | Reset the FlatBufferBuilder by purging all data that it holds. |
| AddBool | 2 | Add a bool to the buffer (aligns the data and grows if necessary). |
| AddSbyte | 2 | Adds a SByte to the Table at index o in its vtable using the value x and default d |
| AddByte | 2 | Add a byte to the buffer (aligns the data and grows if necessary). |
| AddShort | 2 | Add a short to the buffer (aligns the data and grows if necessary). |
| AddUshort | 2 | Adds a UInt16 to the Table at index o in its vtable using the value x and default d |
| AddInt | 2 | Adds an Int32 to the Table at index o in its vtable using the value x and default d |
| AddUint | 2 | Adds a UInt32 to the Table at index o in its vtable using the value x and default d |
| AddLong | 2 | Adds an Int64 to the Table at index o in its vtable using the value x and default d |
| AddUlong | 2 | Adds a UInt64 to the Table at index o in its vtable using the value x and default d |
| AddFloat | 2 | Adds a Single to the Table at index o in its vtable using the value x and default d |
| AddDouble | 2 | Add a double to the buffer (aligns the data and grows if necessary). |
| AddOffset | 2 | Adds a buffer offset to the Table at index o in its vtable using the value x and default d |
| StartVector | 1 | |
| EndVector | 1 | Writes data necessary to finish a vector construction. |
| CreateVectorOfTables | 1 | Creates a vector of tables. |
| Nested | 1 | |
| CreateString | 1 | Encode the string s in the buffer using UTF-8. |
| Finish | 2 | Finalize a buffer, pointing to the given rootTable. |
| SizedByteArray | 1 | A utility function to copy and return the ByteBuffer data as a byte[]. |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| ForceDefaults | 1 | Gets and sets a Boolean to disable the optimization when serializing default values to a Table. |
| Offset | 1 | |
| DataBuffer | 1 | Get the ByteBuffer representing the FlatBuffer. |
04 Members
Int32)Create a FlatBufferBuilder with a given initial size.
| Name | Type | Description |
|---|---|---|
initialSize | Int32 | The initial size to use for the internal buffer. |
Reset the FlatBufferBuilder by purging all data that it holds.
Boolean)Add a bool to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Boolean | The |
Int32, Boolean, Boolean)Adds a Boolean to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Boolean | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Boolean | The default value to compare the value against |
SByte)Add a sbyte to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | SByte | The |
Int32, SByte, SByte)Adds a SByte to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | SByte | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | SByte | The default value to compare the value against |
Byte)Add a byte to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Byte | The |
Int32, Byte, Byte)Adds a Byte to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Byte | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Byte | The default value to compare the value against |
Int16)Add a short to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Int16 | The |
Int32, Int16, Int32)Adds a Int16 to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Int16 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Int32 | The default value to compare the value against |
UInt16)Add an ushort to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | UInt16 | The |
Int32, UInt16, UInt16)Adds a UInt16 to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | UInt16 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | UInt16 | The default value to compare the value against |
Int32)Add an int to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Int32 | The |
Int32, Int32, Int32)Adds an Int32 to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Int32 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Int32 | The default value to compare the value against |
UInt32)Add an uint to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | UInt32 | The |
Int32, UInt32, UInt32)Adds a UInt32 to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | UInt32 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | UInt32 | The default value to compare the value against |
Int64)Add a long to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Int64 | The |
Int32, Int64, Int64)Adds an Int64 to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Int64 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Int64 | The default value to compare the value against |
UInt64)Add an ulong to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | UInt64 | The |
Int32, UInt64, UInt64)Adds a UInt64 to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | UInt64 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | UInt64 | The default value to compare the value against |
Single)Add a float to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Single | The |
Int32, Single, Double)Adds a Single to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Single | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Double | The default value to compare the value against |
Double)Add a double to the buffer (aligns the data and grows if necessary).
| Name | Type | Description |
|---|---|---|
x | Double | The |
Int32, Double, Double)Adds a Double to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Double | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Double | The default value to compare the value against |
Int32)Adds an offset, relative to where it will be written.
| Name | Type | Description |
|---|---|---|
off | Int32 | The offset to add to the buffer. |
Int32, Int32, Int32)Adds a buffer offset to the Table at index o in its vtable using the value x and default d
| Name | Type | Description |
|---|---|---|
o | Int32 | The index into the vtable |
x | Int32 | The value to put into the buffer. If the value is equal to the default and FlatBufferBuilder.ForceDefaults is false, the value will be skipped. |
d | Int32 | The default value to compare the value against |
Int32, Int32, Int32)Writes data necessary to finish a vector construction.
Creates a vector of tables.
| Name | Type | Description |
|---|---|---|
offsets | Offset(Of ``0)() | Offsets of the tables. |
Int32)String)Encode the string s in the buffer using UTF-8.
| Name | Type | Description |
|---|---|---|
s | String | The string to encode. |
The offset in the buffer where the encoded string starts.
Int32)Finalize a buffer, pointing to the given root_table.
| Name | Type | Description |
|---|---|---|
rootTable | Int32 | An offset to be added to the buffer. |
Int32, String)Finalize a buffer, pointing to the given rootTable.
| Name | Type | Description |
|---|---|---|
rootTable | Int32 | An offset to be added to the buffer. |
fileIdentifier | String | A FlatBuffer file identifier to be added to the buffer before |
A utility function to copy and return the ByteBuffer data as a byte[].
A full copy of the FlatBuffer data.
Gets and sets a Boolean to disable the optimization when serializing default values to a Table.
In order to save space, fields that are set to their default value don't get serialized into the buffer.
Get the ByteBuffer representing the FlatBuffer.
This is typically only called after you call Finish(). The actual data starts at the ByteBuffer's current position, not necessarily at 0.
Returns the ByteBuffer for this FlatBuffer.