Replies: 1 comment
-
I think I might have found a way to do this by adding a file identifier to the next edition of the format. I can then check if it is present and act accordingly. Something like... if (flatbuffers::BufferHasIdentifier(buffer.data(), "MYID", /*size_prefixed=*/ true)) {
// new handling
} else {
// old handling
} This might not be the best way to do it but it solves my particular case. Hopefully, this might be useful to someone else, or if not please let me know a better way 🙂 Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I have some serialized data I'd like to ideally keep working which was originally created without using
FinishSizePrefixed
orGetSizePrefixed...
. I would like to add some new data I serialize to the same file, and using the size prefix for this would be very convenient (essentially allowing me to combine two streams of data).The problem I'm finding though is I don't know if the file I'm loading is going to be size prefixed or not (old version vs new version). Is there a way to check this when loading a file from disk before attempting to deserialize it? How would one migrate from not using a size prefixed buffer to using a size prefixed buffer? Is this possible?
Any pointers/suggestions would be hugely appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions