Builder class

Class that helps building flat buffers.

Constructors

Builder({int initialSize: 1024, bool internStrings: false})
Creates a new FlatBuffers Builder. [...]

Properties

initialSize → int
final
offset → int
The number of bytes that have been written to the buffer so far. The most recently written byte is this many bytes from the end of the buffer.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addBool(int field, bool value, [bool def]) → void
Add the field with the given boolean value. The field is not added if the value is equal to def. Booleans are stored as 8-bit fields with 0 for false and 1 for true.
addFloat32(int field, double value, [double def]) → void
Add the field with the given 32-bit float value. The field is not added if the value is equal to def.
addFloat64(int field, double value, [double def]) → void
Add the field with the given 64-bit double value. The field is not added if the value is equal to def.
addInt8(int field, int value, [int def]) → void
Add the field with the given 8-bit signed integer value. The field is not added if the value is equal to def.
addInt16(int field, int value, [int def]) → void
Add the field with the given 32-bit signed integer value. The field is not added if the value is equal to def.
addInt32(int field, int value, [int def]) → void
Add the field with the given 32-bit signed integer value. The field is not added if the value is equal to def.
addInt64(int field, int value, [double def]) → void
Add the field with the given 64-bit unsigned integer value. The field is not added if the value is equal to def.
addOffset(int field, int offset) → void
Add the field referencing an object with the given offset.
addStruct(int field, int offset) → void
addUint8(int field, int value, [int def]) → void
Add the field with the given 8-bit unsigned integer value. The field is not added if the value is equal to def.
addUint16(int field, int value, [int def]) → void
Add the field with the given 32-bit unsigned integer value. The field is not added if the value is equal to def.
addUint32(int field, int value, [int def]) → void
Add the field with the given 32-bit unsigned integer value. The field is not added if the value is equal to def.
addUint64(int field, int value, [double def]) → void
Add the field with the given 64-bit unsigned integer value. The field is not added if the value is equal to def.
endStructVector(int count) → int
Finish a Struct vector. Most callers should preferto use writeListOfStructs. [...]
endTable() → int
End the current table and return its offset.
finish(int offset, [String fileIdentifier]) → Uint8List
Finish off the creation of the buffer. The given offset is used as the root object offset, and usually references directly or indirectly every written object. If fileIdentifier is specified (and not null), it is interpreted as a 4-byte Latin-1 encoded string that should be placed at bytes 4-7 of the file.
lowFinish() → Uint8List
This method low level method can be used to return a raw piece of the buffer after using the the put* methods. [...]
pad(int howManyBytes) → void
Zero-pads the buffer, which may be required for some struct layouts.
putFloat32(double value) → void
Writes a Float32 to the tail of the buffer after preparing space for it. [...]
putFloat64(double value) → void
Writes a Float64 to the tail of the buffer after preparing space for it. [...]
putInt8(int value) → void
Writes a Uint8 to the tail of the buffer after preparing space for it. [...]
putInt16(int value) → void
Writes a Uint16 to the tail of the buffer after preparing space for it. [...]
putInt32(int value) → void
Writes a Uint32 to the tail of the buffer after preparing space for it. [...]
putInt64(int value) → void
Writes a Int64 to the tail of the buffer after preparing space for it. [...]
putUint8(int value) → void
Writes a Uint8 to the tail of the buffer after preparing space for it. [...]
putUint16(int value) → void
Writes a Uint16 to the tail of the buffer after preparing space for it. [...]
putUint32(int value) → void
Writes a Uint32 to the tail of the buffer after preparing space for it. [...]
putUint64(int value) → void
Writes a Uint64 to the tail of the buffer after preparing space for it. [...]
reset() → void
Reset the builder and make it ready for filling a new buffer.
startTable() → void
Start a new table. Must be finished with endTable invocation.
writeList(List<int> values) → int
Write the given list of values.
writeListBool(List<bool> values) → int
Write the given list of bools as unsigend 8-bit integer values.
writeListFloat32(List<double> values) → int
Write the given list of 32-bit float values.
writeListFloat64(List<double> values) → int
Write the given list of 64-bit float values.
writeListInt8(List<int> values) → int
Write the given list of signed 8-bit integer values.
writeListInt16(List<int> values) → int
Write the given list of signed 16-bit integer values.
writeListInt32(List<int> values) → int
Write the given list of signed 32-bit integer values.
writeListInt64(List<int> values) → int
Write the given list of signed 64-bit integer values.
writeListOfStructs(List<ObjectBuilder> structBuilders) → int
Writes a list of Structs to the buffer, returning the offset
writeListUint8(List<int> values) → int
Write the given list of unsigned 8-bit integer values.
writeListUint16(List<int> values) → int
Write the given list of unsigned 16-bit integer values.
writeListUint32(List<int> values) → int
Write the given list of unsigned 32-bit integer values.
writeListUint64(List<int> values) → int
Write the given list of signed 64-bit integer values.
writeString(String value) → int
Write the given string value and return its offset, or null if the value is null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited