You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a CodedInputStream already, then it's pretty easy to read the size followed by the content directly. I originally created parseDelimitedFrom() mainly because reading a delimited message from a raw InputStream -- without accidentally reading too much -- is actually pretty tedious. You can't just wrap it in a CodedInputStream because CodedInputStream will immediately read a large buffer which might go past the end of the message, and the goal here was to allow people to read the message and then go back to reading from their simple InputStream after.
(I don't work on protobufs anymore, though, and I don't have a strong opinion on whether or not such an overload should be added for convenience; that's up to the current team.)
As Kenton mentioned, it is pretty easy to do this manually. I don't think it's worth the extra API surface to add this. Especially since adding thing to one language (like Java) inevitably turns up requests to add it to other languages (like C++).
Why is it not possible to use parseDelimitedFrom on a CodedInputStream?
e.g.
parser.parseDelimitedFrom(CodedInputStream cis);
The text was updated successfully, but these errors were encountered: