1 Mar 2012 01:00
Re: Issue 256 in protobuf: Error Converting Message to array of Bytes (When negative Enum) - Java
<protobuf <at> googlecode.com>
2012-03-01 00:00:35 GMT
2012-03-01 00:00:35 GMT
Comment #8 on issue 256 by jhan... <at> gmail.com: Error Converting Message to array of Bytes (When negative Enum) - Java http://code.google.com/p/protobuf/issues/detail?id=256 Any update on this? I'm running into this exception running version 2.4.1 Is there any way from the public API to set the underlying buffer size of the CodedOutputStream? We are not creating that directly. We are calling writeDelimitedTo() Any help is appreciated. -- -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf <at> googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
. Is there a wrapper built in to do this?
Yes. Sadly there is no wrapper included in the library.
> 2. If I understand Jason's suggestion riht, the length is really not
> part of the message, and the sender has to explcitly set it, instead
> of having protobuf encode it in. Which means a generic third party
> sender using my .proto file would not be sufficient. Plus how would
> they know the length before encoding the message proper? Filling it in
> after the fact would change the length again? or I am totally
> missing it.
As long as both sides encode the length in the same way , just having the right .proto will do the trick.
> 3. A related quesiton is in general do I have to manage reading of the
> socket, or for that matter any istream, and spoon feed the protobuf
> parser until it says OK, that's a whole message?
Basically yes. There is a sketch of some example code here:
RSS Feed