On Fri, May 8, 2009 at 9:49 PM, <clinton.fos...@quest.com> wrote: > It was necessary to add a length prefix to the request/response > messages in order to remove the dependency on closing the connection > to know when the protobuf was finished being read. Also, since > Message.Builder.mergeFrom() expects to be able to read the InputStream > to the "end", I had to create a FilterInputStream to trick it into > thinking the "end" was the end of the protobuf. The other option would > have been to use the version that accepts a byte array, but that seems > less ideal because it would limit the size of messages that could be > processed.
Note that protobuf v2.1.0 introduces methods Message.writeDelimitedTo() and Builder.mergeDelimitedFrom() which deal with all this for you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~----------~----~----~----~------~----~------~--~---