Hello everybody,
I have a small dilemma with regards to protocol buffers. I read the
documentation but I still do not see a clear answer (I only use the
Java version of protocol buffers). I hope I am not missing something
really obvious here ...
I have the following setup:
message Item {
optional string name = 1;
optional string description = 2;
}
message Bag{
repeated Item item= 1;
}
In the code, a Bag (with a significantly big number of items) gets
serialized to a file. Now, lets suppose the file gets corrupted in the
middle (arbitrary point). From my experiments, the entire content
would be lost because Bag cannot be deserialized anymore. To construct
the Bag, I use the parseFrom() method and I get exceptions. I do not
see anything in the documentation that would suggest mergeFrom() would
have a different result either.
I do not expect to be able to recover any individual corrupted items
but it would be nice to be able to recover the rest of the list.
What could I do reduce the risk of losing the entire list due to
arbitrary corruption? What if corruption only occurs at the end of the
file, would it be simpler to recover all the elements up to the
corruption point?
Thanks for your help!
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.