Questions tagged [flatbuffers]

FlatBuffers is a serialization library by Google. It is particularly suitable for games and other memory-constrained applications.

FlatBuffers is a serialization library by Google.

Rather than unpacking the data, it allows the user to directly access the serialized data, thus reducing the memory requirements. For that reason, it is particularly suitable for games and other memory constrained applications.

384 questions
3
votes
1 answer

Do FlatBuffers have size limits?

Can I store a 100GB string in a FlatBuffer? 10 TB (in 2023 you can buy servers with more RAM than that)? Is it just limited by how much RAM/swap my server has or is there a hard limit you need set like with Protocol Buffers (which you can't set…
Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
3
votes
1 answer

How to convert FlatBuffer message from binary to human readable text format with Python?

I am writing a tool to dump our dedicated ML model from flatbuffers binary into human readable text format, is there any helper like text_format for protobuf?
zmyzhou
  • 43
  • 3
3
votes
1 answer

Flatbuffers struct in union not working (C++)

I am trying to get going with Flatbuffers in C++, but I'm already failing to write and read a struct in a union. I have reduced my original problem to an anonymous, minimal example. Example Schema (favorite.fbs) // favorite.fbs struct…
Neonit
  • 680
  • 8
  • 27
3
votes
1 answer

Using flatbuffers struct as a key

I am considering using flatbuffers' serialized struct as a key in a key-value store. Here is an example of the structs that I want to use as a key in rocksdb. struct Foo { foo_id: int64; foo_type: int32; } I read the documentation and figured…
Himanshu
  • 31
  • 1
3
votes
1 answer

How to stream process a flatbuffer bigger than RAM?

We have following scenario: We are building a flatbuffer application in an environment with only static memory allocation allowed. Our incomming flatbuffers contain software update images which are bigger than our whole available RAM on the…
user259819
  • 149
  • 8
3
votes
1 answer

How to write a vector

I am using the Go flatbuffers interface for the first time. I find the instructions sparse. I would like to write a vector of uint64s into a table. Ideally, I would like to store numbers directly in a vector without knowing how many there are up…
shaunc
  • 5,317
  • 4
  • 43
  • 58
3
votes
1 answer

Accessing a Flatbuffers union in Python

I have the following definitions in my schema file: union UGeometry { Polygon, Point, Linestring } table Point { point:Vec2; } table Polygon { points:[Vec2List]; } table Geometry { g:UGeometry; } (Removed some boilerplate code for…
benjist
  • 2,740
  • 3
  • 31
  • 58
3
votes
0 answers

Flat Buffer with Spring Rest API

Does Spring Rest API support for Flat Buffer? If Yes then please give the link, With the help of that link i can integrate Flat Buffer with Spring.
3
votes
1 answer

How to serialize union of structs in Flatbuffers

Suppose I have the following Flatbuffers schema file: union WeaponProperties { sword: PSword, axe: PAxe, mace: PMace, } struct PSword { length: float32; straight: bool; } struct PAxe { bearded: bool; } struct PMace { hardness:…
Pasha
  • 6,298
  • 2
  • 22
  • 34
3
votes
2 answers

Generated header not found

I'm trying to use Bazel to build a cpp project that use Flatbuffers. But my map_schema_generated.h generated with flatc is not found. My tree: | |_ data | |_ maps | |_ BUILD | |_ map_schema.fbs | |_ src | |_ map | |_ BUILD | |_…
3
votes
1 answer

How to use zero-copy serialization libraries without moving the data?

I am looking for a binary serialization library because JSON turned out to be too slow for our use case. Some lib devs (Flatbuffers, Cap'n Proto, ..) argue against Protobuf because it doesn't follow the zero-copy idea (e.g. 1 and 2). When I think…
Florian
  • 41
  • 1
  • 5
3
votes
2 answers

c++ - protobuf vs rapidjson data format

using rapidJSON I am able to store data of any type (supported by rapidJSON) as value against a key. Can I do that in protobuf? If so, how? The reason I opted for protobuf over rapidJSON is because of its speed (and key comparison in rapidJSON is…
helix
  • 1,017
  • 3
  • 12
  • 30
3
votes
2 answers

Is the Java implementation for FlatBuffer's zero-allocation?

My Java application is storing Protobuf messages in a database. The application is fast, but it could be made faster because not all parts of the messages are always used, causing wasted CPU cycles on unneeded data. Also, some messages have…
user1428945
  • 339
  • 1
  • 13
3
votes
1 answer

FlatBuffers - Error when creating Vector of struct

I am very new to flatbuffers and believe I am following the tutorial correctly but modifying it to my needs, but cannot for the life of me work out why i'm getting this error: error: could not convert ‘_Positions’ from…
user181782
  • 45
  • 1
  • 8
3
votes
2 answers

Convert FlatBuffer to JSON from various languages

Does FlatBuffer allow to convert a binary fbs file to and from JSON (of course the schema will be known)? My idea is to define the schema of structures for a pipe&filter architecture in FlatBuffer. The FlatBuffer files will also be exchanged between…
benjist
  • 2,740
  • 3
  • 31
  • 58
1 2
3
25 26