Which method should you use to write all buffered data in the stream to the device without losing any buffered data?

You are busy using the XmlWriter class to write large amount of XML data to a physical device via a buffer stream. Which method should you use to write all buffered data in the stream to the device without losing any buffered data?

You are busy using the XmlWriter class to write large amount of XML data to a physical device via a buffer stream. Which method should you use to write all buffered data in the stream to the device without losing any buffered data?

A.
WriteFullEndElement

B.
Flush

C.
Close

D.
WriteEndDocument

Explanation:
The flush method flushes the underlying stream by writing all buffered data to the underlying device and it does not loose any data.

Incorrect Answers:
A: The WriteFullEndElement method closes the current document which is open.
C: The Close method closes the underlying stream. This will cause you to loose data.
D: The WriteEndDocument method closes all the open documents.



Leave a Reply 0

Your email address will not be published. Required fields are marked *