JsonReaderWriterFactory.CreateJsonReader Method (Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)


Creates an XmlDictionaryReader that can map streams encoded with JavaScript Object Notation (JSON), of a specified size and offset, to an XML Infoset.

Namespace:   System.Runtime.Serialization.Json
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

public static XmlDictionaryReader CreateJsonReader(
	Stream stream,
	Encoding encoding,
	XmlDictionaryReaderQuotas quotas,
	OnXmlDictionaryReaderClose onClose


Type: System.IO.Stream

The input Stream from which to read.

Type: System.Text.Encoding

The Encoding that specifies the character encoding used by the reader. If null is specified as the value, the reader attempts to auto-detect the encoding.

Type: System.Xml.XmlDictionaryReaderQuotas

The XmlDictionaryReaderQuotas used to prevent Denial of Service attacks when reading untrusted data.

Type: System.Xml.OnXmlDictionaryReaderClose

The OnXmlDictionaryReaderClose delegate to call when the reader is closed.

Return Value

Type: System.Xml.XmlDictionaryReader

An XmlDictionaryReader that can read JavaScript Object Notation (JSON).

For more information about using XmlDictionaryReaderQuotas to prevent Denial of Service attacks when reading untrusted data, see Security Considerations for Data.

.NET Framework
Available since 3.5
Return to top