This method writes out the preamble associated with the
XML encoding if it has not been written already and
then writes out all of the values that been
written to the stream since the last time flush
was called. After flushing, all internal references to the
values that were written to this stream are cleared.
Diagram: Persistence