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 */) {
   msg.writeTo(out);
}
out.flush();

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

Hope this helps,

Evan

-- 
Evan Jones
http://evanjones.ca/

--~--~---------~--~----~------------~-------~--~----~
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 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to