The standard solution for this is to length-delimit your messages in the
file with CodedOutputStream. So you create a CodedOutputStream for the file
(call it coded_output_stream), and then for each message, something like
Then to read them in, for each message:
CodedInputStream::Limit old_limit = coded_input_stream.PushLimit(size);
2010/7/23 Julian González <julian....@gmail.com>
> I am a newbie with Protocol Buffers I think I can use it in my
> application because right now I am using a CSV file and it takes a
> while to generate the file and also it is very big, I mean huge above
> 2 GB, so I thought switching to a binary format would be better I
> found protocol buffers, I really like it, it is easy and flexible but
> I could find how to write several messages of the same type in a
> single file. In my application I write samples, millions o samples and
> every sample contains like 6 different fields, I would like to use
> protocol buffer, but so far I could not find a way to write a read
> several messages. Can somebody help me?
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> For more options, visit this group at
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at