Table of Contents

Chunk Method

Definition

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

Chunk(IDecorator<XmlReader>, int, Action<XmlWriterSettings>)

Creates and returns a sequence of chunked XmlReader instances from the enclosed XmlReader of the specified decorator with a maximum of the specified size of XML node elements located on a depth of 1.

public static IEnumerable<XmlReader> Chunk(this IDecorator<XmlReader> decorator, int size = 128, Action<XmlWriterSettings> setup = null)

Parameters

decorator IDecorator<XmlReader>

The IDecorator<T> to extend.

size int

The amount of XML node elements allowed per XmlReader object. Default is 128 XML node element.

setup Action<XmlWriterSettings>

The XmlWriterSettings which may be configured.

Returns

IEnumerable<XmlReader>

An sequence of XmlReader instances that contains no more than the specified size of XML node elements from the enclosed XmlReader of the specified decorator.

Exceptions

ArgumentNullException

decorator is null.

ArgumentException

The Read() method of the enclosed XmlReader of the specified decorator object has already been called.