I'm experiencing the same issue too and I was wondering if you could please 
elaborate on what you mean by destroying it before using its output? Delete 
OstreamOutputStream and try to get the string contained in stringstream?

I tried using StringOutputStream, but it seems like when I did 
coded_output->WriteString(serialized_string), sometimes serialized_string's 
content will be chopped off. I was wondering if you also might have any 
idea why this is happening.

On Sunday, April 14, 2013 at 1:59:26 PM UTC-7, Oliver Jowett wrote:
>
> On Sun, Apr 14, 2013 at 7:26 PM, Predator33 <[email protected] 
> <javascript:>> wrote:
>
>> The only thing I could think of is maybe the protobuf stream doesn't 
>> flush itself out until the destructor is hit and since that never happens 
>> until after the fact, it never gets flushed?
>>
>
> Yes, this will be what is happening. Arrange for the OstreamOutputStream 
> to be destroyed before you try to use its output (e.g. wrap that 
> declaration in another level of nesting)
>
> Is there some reason why you're using stringstream + OstreamOutputStream, 
> rather than just using StringOutputStream?
>
> Oliver
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/dfc6c277-349f-465a-81d9-f87c8de84985%40googlegroups.com.

Reply via email to