JsonReaderWriterFactory.CreateJsonReader Method (array<Byte[], Int32, Int32, XmlDictionaryReaderQuotas)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
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)
Syntax
'Declaration
Public Shared Function CreateJsonReader ( _
buffer As Byte(), _
offset As Integer, _
count As Integer, _
quotas As XmlDictionaryReaderQuotas _
) As XmlDictionaryReader
public static XmlDictionaryReader CreateJsonReader(
byte[] buffer,
int offset,
int count,
XmlDictionaryReaderQuotas quotas
)
Parameters
- buffer
Type: array<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.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | stream is nulla null reference (Nothing in Visual Basic). |
ArgumentOutOfRangeException | offset is negative or exceeds the buffer length. |
ArgumentOutOfRangeException | count is negative or exceeds the buffer length minus the offset. |
Remarks
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.
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.