Table of Contents

ToStream Method

Definition

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

ToStream(XmlReader, Action<XmlCopyOptions>)

Copies everything from the specified reader and returns the result as an XML stream.

public static Stream ToStream(this XmlReader reader, Action<XmlCopyOptions> setup = null)

Parameters

reader XmlReader

The XmlReader to extend.

setup Action<XmlCopyOptions>

The XmlCopyOptions which may be configured.

Returns

Stream

A Stream holding an exact copy of the source reader.

Exceptions

ArgumentNullException

reader is null.

ToStream(XmlReader, Action<XmlWriter, XmlReader, DisposableOptions>, Action<XmlCopyOptions>)

Copies the specified reader using the specified delegate copier and returns the result as an XML stream.

public static Stream ToStream(this XmlReader reader, Action<XmlWriter, XmlReader, DisposableOptions> copier, Action<XmlCopyOptions> setup = null)

Parameters

reader XmlReader

The XmlReader to extend.

copier Action<XmlWriter, XmlReader, DisposableOptions>

The delegate that will create an in-memory copy of reader as a XML stream.

setup Action<XmlCopyOptions>

The XmlCopyOptions which may be configured.

Returns

Stream

A Stream holding the XML copied by the delegate copier from the source reader.

Exceptions

ArgumentNullException

reader is null - or - copier is null.