Table of Contents

ToXmlReader Method

Definition

Namespace
Cuemon.Extensions.Xml
Assemblies
Cuemon.Extensions.Xml.dll
Source
src/Cuemon.Extensions.Xml/StreamExtensions.cs

ToXmlReader(Stream, Encoding, Action<XmlReaderSettings>)

Converts the given value to an XmlReader.

public static XmlReader ToXmlReader(this Stream value, Encoding encoding = null, Action<XmlReaderSettings> setup = null)

Parameters

value Stream

The XML Stream to extend.

encoding Encoding

The text encoding to use.

setup Action<XmlReaderSettings>

The XmlReaderSettings which may be configured.

Returns

XmlReader

An XmlReader representation of value.

Remarks

If encoding is null, an Encoding object will be attempted resolved by TryDetectXmlEncoding(Stream, out Encoding).

Exceptions

ArgumentNullException

value cannot be null.