I think I found the source of the problem. The problem is that
CodedInputStream has internal counter of how many bytes are read so far with
the same object.
In my case, there are a lot of small messages saved in the same file. I do
not read them at once and therefore do not care about large messages,
limits. I am safe.
So, the problem can be easily solved by calling:
My use-case is really about storing extremely large number (up to 1e9) of
small messages ~ 10K each.
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at