Gilad Ben-Ami wrote: > Do you think that using std::iostream in the following scenario would > work / be a good choice? > 1. read message_length > 2. buffer message_length bytes into iostream variable. > 3. when all data is received, use IstreamInputStream to wrap the > iostream and have it parsed with ParseFromZeroCopyStream()
If your application doesn't have a buffer already, I recommend using std::string. AFAIK, the C++ standard library doesn't provide anything more appropriate. It will do a good enough job, particularly if you re-use one std::string rather than allocating a new one for each message. The reason to use something more complicated is because lots of applications already have some sort of buffer, and you want to try and avoid extra copies. Evan -- 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.
