Input Streams and Strings
When you add a document to a container, you must identify the location where the document resides. You can do this by using:
- A string object that holds the entire document.
- An input stream that is created from a filename. Use CreateLocalFileInputStream(String) to create the input stream.
- Using PutDocument(XmlDocument, UpdateContext), which loads the specified file as an XmlInputStream and inserts the stream into the container.
Figaro does not validate an input stream until you actually attempt to put the document to your container. This means that you can create an input stream to an invalid location or to invalid content, and Figaro will not throw an exception until you actually attempt to load data from that location.