Hi all --
I have a system that has a large number of read and writes that is
storing messages as protocol buffers.
All was working well, until I recently started noticing some corrupt
(I'm assuming they're corrupt at least) protocol buffers. This is
giving me some exceptions like this:
com.google.protobuf.InvalidProtocolBufferException: While parsing a
protocol message, the input ended unexpectedly in the middle of a
field. This could mean either than the input has been truncated or
that an embedded message misreported its own length.
My question is -- can anything be done to retrieve part of the file?
It would be nice to know at which point in the file the problematic
message occurred, and then I could crop to that point or do some
manual exception -- but unfortunately this exception is very general.
I find it hard to believe that a single mis-saved bit makes the whole
I also find it curious that the source provides no way (that I can
tell) to get at any lower level data in the p.b. since whenever I try
to do anything with it it throws an exception. Best I can tell I will
have to write from scratch my own code to decode the p.b. file.
Has anyone found a better way to deal with this?
Thanks so much -J
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to
For more options, visit this group at