Besides this patch, one workaround that I have also used is switching to 


On Thursday, January 2, 2014 11:47:26 AM UTC-8, 
> Status: New 
> Owner: ---- 
> Labels: Type-Defect Priority-Medium 
> New issue 592 by OstreamOutputStream with ofstream 
> loses data from the tail 
> What steps will reproduce the problem? 
> 1. Use an OstreamOutputStream with an ofstream as the underlying IO 
> stream. 
> 2. Write data that is not aligned to the buffer boundary for the ofstream 
> implementation.  This happens surprisingly often for me (e.g. try writing 
> somewhere between 8192 and 8192+127 bytes).  It happens even with fewer   
> bytes. 
> 3. Alternatively, the attached patch adds a test to   
> which fails without the attached fix. 
> What is the expected output? What do you see instead? 
> Expected output is that OstreamOutputStream should work regardless of the 
> amount of data written.  The attached fix addresses this issue by adding a 
> Flush operation to the underlying implementation. 
> Please use labels and text to provide additional information. 
> Protobuf version 2.5.0 
> gcc version used was 4.8.1, clang version 3.0 
> Attachments: 
>         protobuf-OstreamOutputStream.patch  2.8 KB 
> -- 
> You received this message because this project is configured to send all   
> issue notifications to this address. 
> You may adjust your notification preferences at: 

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 post to this group, send email to
Visit this group at
For more options, visit

Reply via email to