Hi,
I've just started looking into Flatbuffers, so please bear with me if I've missed something obvious here. I'm currently looking into using flatbuffers as a serialization format for the payload in a networking protocol. My initial tests so far looks good, but I have some situations where using flatbuffers would result in a significant increase of memory copying (adding a "blob" that may be up to ~20MB).
In my current protocol we've got our own serialization format, and we're using an IO vector so that I don't copy the blob at all. From what I can see I don't have that possibility in flatbuffers, so I'm currently thinking about just putting the blob behind the flatbuffer-encoded data. I know the entire "frame size", but is there an easy way to determine the size of the flatbuffer buffer when I'm decoding the message?
Let's say I've got something like:
table Foo {
...
}
root_type Foo;
And then in my code I've got something like:
auto foo = GetFoo(payload.data());
How do I determine the number of bytes the response occupies? or would I be better off to store the "value size" in the object? (by doing so I could add other "blobs" later on....)
Cheers,
Trond