/// <summary> /// Creates an instance of the XmlTextWriter class using the specified stream and vocabulary. /// </summary> /// <param name="output">The stream to which you want to write.</param> /// <param name="vocabulary">The initial vocabulary used to provide the initial state of the internal vocabulary tables.</param> public FIWriter(Stream output, FIVocabulary vocabulary) { if (vocabulary != null) { _internalWriter = new InternalFIWriter(output, vocabulary.Writer); } else { _internalWriter = new InternalFIWriter(output, null); } _state = FIState.Start; _depth = 0; _documentEnded = false; }
/// <summary> /// Creates an instance of the FIWriter class class using the specified file and vocabulary. /// </summary> /// <param name="filename">The file to which you want to write. If the file exists, it truncates it and overwrites it with the new content.</param> /// <param name="vocabulary">The initial vocabulary used to provide the initial state of the internal vocabulary tables.</param> public FIWriter(string filename, FIVocabulary vocabulary) : this(new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.Read), vocabulary) { }