wire / wire-format / flatbuffers

FlatBuffers (flat binary serialization)

FlatBuffers is a zero-copy serialization format by Google. A FlatBuffer: root table offset (4 bytes, relative to the buffer start), then tables. Each table: vtable offset (relative, signed 32-bit), then fields. Vtables: size (2 bytes), number of fields (2 bytes), then field offsets (2 bytes each). Strings: 4-byte length + UTF-8 data + NUL padding. Vectors: 4-byte length + elements.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: FlatBuffers (flat binary serialization)

wire format

spec: FlatBuffers (google.github.io/flatbuffers)

FlatBuffers is a zero-copy serialization format by Google. A FlatBuffer: root table offset (4 bytes, relative to the buffer start), then tables. Each table: vtable offset (relative, signed 32-bit), then fields. Vtables: size (2 bytes), number of fields (2 bytes), then field offsets (2 bytes each). Strings: 4-byte length + UTF-8 data + NUL padding. Vectors: 4-byte length + elements.

fieldsizemeaning
Root table offset4 bytes (uoffset32)Offset from buffer start to the root table.
Tablevariablevtable offset (soffset32, signed) + field data (scalars, offsets to strings/vectors/tables).
VTablevariablevtable size (uint16) + number of fields (uint16) + field offsets (uint16 each, 0 = absent/default).
StringvariableLength (uint32) + UTF-8 bytes + NUL terminator (padded to 4-byte alignment).
VectorvariableLength (uint32) + elements (padded to element alignment).
StructfixedInline fixed-size data (no vtable, no indirection).

example:

10 00 00 00 00 00 08 00 0c 00 00 00 00 00 00 00 00 00 00 00

FlatBuffer: root offset 16, empty table with vtable


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/flatbuffers or /wire-format/flatbuffers.json