JsonReaderWriterFactory.CreateJsonReader Method (Byte[], Int32, Int32, XmlDictionaryReaderQuotas)

Creates an XmlDictionaryReader that can map a buffer 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.Json (in System.Runtime.Serialization.Json.dll)

public static XmlDictionaryReader CreateJsonReader(
	byte[] buffer,
	int offset,
	int count,
	XmlDictionaryReaderQuotas quotas
)

Parameters

buffer
Type: System.Byte[]
The input Byte buffer array from which to read.
offset
Type: System.Int32
Starting position from which to read in buffer.
count
Type: System.Int32
Number of bytes that can be read from buffer.
quotas
Type: System.Xml.XmlDictionaryReaderQuotas
The XmlDictionaryReaderQuotas must be set to Max in Silverlight 5 applications.

Return Value

Type: System.Xml.XmlDictionaryReader
An XmlDictionaryReader that can read JSON.

ExceptionCondition
ArgumentNullException

stream is null.

ArgumentOutOfRangeException

offset is negative or exceeds the buffer length.

ArgumentOutOfRangeException

count is negative or exceeds the buffer length minus the offset.

The character encoding (UTF-8, Unicode or Big-Endian Unicode) is auto-detected when the data is read.

Setting XmlDictionaryReaderQuotas to Max in Silverlight 5 applications effectively disables the use of quotas.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: