CStoss wrote:
> So I replaced that code using a Protocol Buffer Message, so in memory
> I persisted the MIgrationPlan object, then I sent it to an
> updateProgress() method which used Message.newBuilder().setXXXX().build
> ().writeTo(FileOutputStream)

If you are writing a lot of objects out to a single stream, you should do:

CodedOutputStream out = CodedOutputStream.newInstance(outputStream);
for (Message msg : /* all your objects */) {

Re-using a single CodedOutputStream will save you a lot of extra 
allocations and extra calls to FileOutputStream.write();

Hope this helps,


Evan Jones

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to