I have the following protobuf:
message FrameData {
... arbitrarily complex ...
}
message DataDump {
optional uint64 headerField1 = 1;
optional uint64 headerField2 = 2;
optional uint64 headerField3 = 3;
repeated FrameData frameData = 4;
}
I'm creating the frameData protobufs iteratively one by one and I want to write the DataDump protobuf to a file.
I can do that by simply building my DataDump protobuf and then calling SerializeToOstream - the problem with that is the data is a few 100gb and this way I would need to first build up all that data in ram before being able to dump it to disk.
Since the repeated field frameData is the last one in the protobuf, I assume it should be possible to first write the headers to the file and then stream out the elements of frameData iteratively after each FrameData protobuf has been generated.
How can this be done?