On Aug 16, 2010, at 10:56 , Prakash Rao wrote:
I'm just looking for a easy way to write null response if data is not present in DB and write proto message object if data is present & parse these in client side appropriately. I didn't get a easy way to do this using CodedInputStream. Currently i'm creating a empty proto object on server side and checking for key attribute at client side as stated above.
The "empty" protocol buffer message serializes to zero bytes, so if your message has no content, you could just send a zero byte message. This would avoid creating a protocol buffer message. However, I suspect that isn't really a big overhead. You can also use YourProtocolMessage.getDefaultInstance() to avoid creating a message.
Hope this helps, Evan Jones -- Evan Jones http://evanjones.ca/ -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
