NativeFlatBufferBuilder class final

Implements the pinned Builder API through guarded composition, including model callbacks. No raw allocator or writable buffer escapes this facade.

Implemented types

Properties

allocationCount → int
no setter
buffer → Uint8List
Returns the finished buffer. You must call finish before accessing this.
no setteroverride
deduplicateTables → bool
final
growthCopiedBytes → int
no setter
hashCode → int
The hash code for this object.
no setterinherited
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.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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.
override
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.
override
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.
override
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.
override
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.
override
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.
override
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.
override
addOffset(int field, int? offset) → void
Add the field referencing an object with the given offset.
override
addStruct(int field, int offset) → void
override
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.
override
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.
override
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.
override
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.
override
dispose() → void
endStructVector(int count) → int
Finish a Struct vector. Most callers should preferto use writeListOfStructs.
override
endTable() → int
End the current table and return its offset.
override
finish(int offset, [String? fileIdentifier]) → void
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.
override
freeze() → NativeOwnedBuffer
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pad(int howManyBytes) → void
Zero-pads the buffer, which may be required for some struct layouts.
override
putBool(bool value) → void
Writes a bool to the tail of the buffer after preparing space for it. Bools are represented as a Uint8, with the value set to '1' for true, and '0' for false
override
putFloat32(double value) → void
Writes a Float32 to the tail of the buffer after preparing space for it.
override
putFloat64(double value) → void
Writes a Float64 to the tail of the buffer after preparing space for it.
override
putInt16(int value) → void
Writes a Uint16 to the tail of the buffer after preparing space for it.
override
putInt32(int value) → void
Writes a Uint32 to the tail of the buffer after preparing space for it.
override
putInt64(int value) → void
Writes a Int64 to the tail of the buffer after preparing space for it.
override
putInt8(int value) → void
Writes a Uint8 to the tail of the buffer after preparing space for it.
override
putUint16(int value) → void
Writes a Uint16 to the tail of the buffer after preparing space for it.
override
putUint32(int value) → void
Writes a Uint32 to the tail of the buffer after preparing space for it.
override
putUint64(int value) → void
Writes a Uint64 to the tail of the buffer after preparing space for it.
override
putUint8(int value) → void
Writes a Uint8 to the tail of the buffer after preparing space for it.
override
reset() → void
Reset the builder and make it ready for filling a new buffer.
override
size() → int
Calculate the finished buffer size (aligned).
override
startTable(int numFields) → void
Start a new table. Must be finished with endTable invocation.
override
toString() → String
A string representation of this object.
inherited
writeList(List<int> values) → int
Write the given list of values.
override
writeListBool(List<bool> values) → int
Write the given list of bools as unsigend 8-bit integer values.
override
writeListFloat32(List<double> values) → int
Write the given list of 32-bit float values.
override
writeListFloat64(List<double> values) → int
Write the given list of 64-bit float values.
override
writeListInt16(List<int> values) → int
Write the given list of signed 16-bit integer values.
override
writeListInt32(List<int> values) → int
Write the given list of signed 32-bit integer values.
override
writeListInt64(List<int> values) → int
Write the given list of signed 64-bit integer values.
override
writeListInt8(List<int> values) → int
Write the given list of signed 8-bit integer values.
override
writeListOfStructs(List<ObjectBuilder> structBuilders) → int
Writes a list of Structs to the buffer, returning the offset
override
writeListUint16(List<int> values) → int
Write the given list of unsigned 16-bit integer values.
override
writeListUint32(List<int> values) → int
Write the given list of unsigned 32-bit integer values.
override
writeListUint64(List<int> values) → int
Write the given list of signed 64-bit integer values.
override
writeListUint8(List<int> values) → int
Write the given list of unsigned 8-bit integer values.
override
writeString(String value, {bool asciiOptimization = false}) → int
Write the given string value and return its offset.
override

Operators

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