示例#1
0
        public void SetOutput(Stream stream, Encoding encoding, bool ownsStream)
        {
            if (stream == null)
                throw new ArgumentNullException("stream");
            if (encoding == null)
                throw new ArgumentNullException("encoding");
            if (encoding.WebName != Encoding.UTF8.WebName)
            {
                stream = new EncodingStreamWrapper(stream, encoding, true);
            }

            if (_writer == null)
            {
                _writer = new XmlUTF8NodeWriter();
            }
            _writer.SetOutput(stream, ownsStream, encoding);
            SetOutput(_writer);
        }
        public void SetOutput(Stream stream, Encoding encoding, bool ownsStream)
        {
            if (stream == null)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream");
            if (encoding == null)
                throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("encoding");
            if (encoding.WebName != Encoding.UTF8.WebName)
            {
                stream = new EncodingStreamWrapper(stream, encoding, true);
            }

            if (writer == null)
            {
                writer = new XmlUTF8NodeWriter();
            }
            writer.SetOutput(stream, ownsStream, encoding);
            SetOutput(writer);
        }
 public void SetOutput(Stream stream, Encoding encoding, bool ownsStream)
 {
     if (stream == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream");
     }
     if (encoding == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("encoding");
     }
     if (encoding.WebName != Encoding.UTF8.WebName)
     {
         stream = new EncodingStreamWrapper(stream, encoding, true);
     }
     if (this.writer == null)
     {
         this.writer = new XmlUTF8NodeWriter();
     }
     this.writer.SetOutput(stream, ownsStream, encoding);
     base.SetOutput(this.writer);
 }
示例#4
0
 public void SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
 {
     if (stream == null)
         throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream");
     MoveToInitial(quotas, onClose);
     stream = new EncodingStreamWrapper(stream, encoding);
     BufferReader.SetBuffer(stream, null, null);
     _buffered = false;
 }
 public void SetInput(Stream stream, Encoding encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose onClose)
 {
     if (stream == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream");
     }
     this.MoveToInitial(quotas, onClose);
     stream = new EncodingStreamWrapper(stream, encoding);
     base.BufferReader.SetBuffer(stream, null, null);
     this.buffered = false;
 }