I was working on a project that required me to use the currently accepted method of length prefixing flatbuffers to chain them. (i.e. len>fb>len>fb)
It occurred to me that we might be able to do this with an optional field in the root table with an attribute:
This way in our GetRootAsMonster generated code we look for this field and a) if not set then use entire buffer b) if set use as length for buffer (optionally return next index or something to flag more to follow)
I'm sure there maybe some catch to this, but if this was possible it would remove the incompatibility between length prefixed/normal flatbuffers and wouldn't require much overhead. Tables without the length attribute would still assume the entire buffer was valid.
Thoughts?