Example #1
0
        /// <summary>
        /// Saves the configuration to a binary file, using a specific <see cref="BinaryWriter"/>.
        /// </summary>
        ///
        /// <param name="stream">The stream to save the configuration to.</param>
        /// <param name="writer">The writer to use. Specify null to use the default writer.</param>
        ///
        /// <exception cref="ArgumentNullException">When <paramref name="stream"/> is null.</exception>
        public void SaveToBinaryStream(Stream stream, BinaryWriter writer)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            ConfigurationWriter.WriteToStreamBinary(this, stream, writer);
        }
Example #2
0
        /// <summary>
        /// Saves the configuration to a stream.
        /// </summary>
        ///
        /// <param name="stream">The stream to save the configuration to.</param>
        /// <param name="encoding">The character encoding to use. Specify null to use the default encoding, which is UTF8.</param>
        ///
        /// <exception cref="ArgumentNullException">When <paramref name="stream"/> is null.</exception>
        public void SaveToStream(Stream stream, Encoding encoding)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            ConfigurationWriter.WriteToStreamTextual(this, stream, encoding);
        }