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

FlatBuffers KeyValuePair data type and schema definition

I have an object that I need to send over the network using TCP. I had this working fine, but I have now expanded on my implementation and am having trouble working out how to define my FlatBuffer schema. The object to be sent is this: public class…
pookie
  • 3,796
  • 6
  • 49
  • 105
3
votes
1 answer

Simple Flatbuffers over ZeroMQ C example - Copy struct to flatbuffer over zmq and back to a struct again

Posting my work for posterity. Realized after finishing my last example in C++ that I actually needed to do it in C all along (awesome, right?). Both iterations took me considerable effort as a Java programmer and I think a lot of the sample code…
fIwJlxSzApHEZIl
  • 11,861
  • 6
  • 62
  • 71
3
votes
1 answer

How to send FlatBuffers ByteBuffer over network?

I want to send the ByteBuffer from FlatBuffers over network to an Android Application. I tried using echo $builder->sizedByteArray, but then I'm wondering how to deserialize this String.
Antict
  • 597
  • 5
  • 22
3
votes
0 answers

C# Flatbuffers byte array

I am using Flatbuffers to serialize some data, which is then sent over the network via TCP. I can deserialize it just fine in the client application, but I have a problem with some image data that I am sending. I have my flatbuffers schema defined…
pookie
  • 3,796
  • 6
  • 49
  • 105
3
votes
1 answer

How can I rewrite the protobuf scheam with flatbuffer schema?

For example , Here is the protobuf schema code, I want to rewrite them by flatbuffer schema? what is the code like ? message Xx { required uint32 id = 1; optional string name = 2; message Yy { optional string name = 1; } …
hash-X
  • 99
  • 1
  • 2
  • 9
3
votes
1 answer

Flatbuffers didn't generate a Get* method, but did generate *Builder (in c++)?

I recently started experimenting with flatbuffers and am facing a very strange problem. I am able to translate the flatb schema to c++ and compile my c++ code (which includes the generated c++) without errors. I am even able to encode a object using…
Shahbaz
  • 10,395
  • 21
  • 54
  • 83
3
votes
3 answers

serialize and deserialize from flatbuffers to and from bytearray

hi stackoverflow community :) i want create a flatbuffers object in java which i can serialize to a byte array, and later deserialize back in the java object. i work the first time with flatbuffers and i can't initialised a java object. my way step…
Pa Rö
  • 449
  • 1
  • 6
  • 18
2
votes
1 answer

What's the purpose of root type in flatbuffers?

My understanding is that root type is some legacy thing, it is needed only for two reasons: root_type name (name, not content) is used to create some objects, for example embed binary schema. some syntax sugar API is generated only for root type.…
wibotwi
  • 108
  • 6
2
votes
1 answer

Include source files generated by prebuild-event

I want to generate C# classes from a flatbuffer schema, and consume these classes in another project. For this I need to invoke the flatbuffer schema compiler to generate the classes. I do not want to check in the class-files, but rather generate…
MariusQS
  • 23
  • 3
2
votes
1 answer

Converting JSON file to flatbuffers file

I want to convert a JSON file into flatbuffers file (serialize JSON data to flatbuffers data). I already created flatbuffers schema but I do not know where to go from here. The documentation is not clear. It does not contain much detail.
Matthew L.
  • 37
  • 4
2
votes
1 answer

Flatbuffers C++ cmake linking library not found

I am linking against the flatbuffers library in my c++ project with cmake. My CMakeLists.txt looks like: set(FLATBUFFERS_SRC_DIR /root/src/git/flatbuffers) set(FLATBUFFERS_BUILD_TESTS "Off") add_subdirectory(${FLATBUFFERS_SRC_DIR} …
BAR
  • 15,909
  • 27
  • 97
  • 185
2
votes
0 answers

Flatbuffer object returning null on Netty Bytebuffer

We are using Flatbuffer with Java bindings. The application is running Netty4 and has following code for handling Netty request: String id; try { request = PostRequest.getRootAsPostRequest(msg.getPayloadBuffer().nioBuffer()); id =…
Saurav Prakash
  • 1,880
  • 1
  • 13
  • 24
2
votes
1 answer

Why it is necessary to compile the flatc executable file?

Yesterday I compiled the necessary files to create the schemas but let me wondering why it was necessary to do all these steps to create the schemas, why those executables can't be shared directly as a release, is there something I'm missing?
2
votes
0 answers

How to use flatbuffers `key` attribute to simulate HashMap with flatbuffers in Rust?

I need to create a string to string map with flatbuffers in Rust similar to: pub struct HashMapIndex { keyword_by_filter: HashMap // filter text -> keyword } I've found some key flatbuffers attribute that can be put on array…
4ntoine
  • 19,816
  • 21
  • 96
  • 220
2
votes
1 answer

How to copy a flatbuffer to other

I have a nested flatbuffer as following: struct Flat_A { // s.t } struct Flat_B { // s.t } struct Flat_C { flata : Flat_A flatb : Flat_B } I want to create flatbuffer of flata : Flat_A first (in a difference flatbufferbuilder…