Export (0) Print
Expand All

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
)

Parameters

stream
Type: System.IO.Stream

The input Stream from which to read.

encoding
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.

quotas
Type: System.Xml.XmlDictionaryReaderQuotas

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

onClose
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

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft