JsonReaderWriterFactory.CreateJsonReader Method

Definition

Creates an XmlDictionaryReader that can map - streams or buffers encoded with JavaScript Object Notation (JSON) to an XML Infoset.

Overloads

CreateJsonReader(Byte[], XmlDictionaryReaderQuotas)

Creates an XmlDictionaryReader that can map buffers encoded with JavaScript Object Notation (JSON) to an XML Infoset.

CreateJsonReader(Stream, XmlDictionaryReaderQuotas)

Creates an XmlDictionaryReader that can map streams encoded with JavaScript Object Notation (JSON) to an XML Infoset.

CreateJsonReader(Byte[], Int32, Int32, XmlDictionaryReaderQuotas)

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

CreateJsonReader(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.

CreateJsonReader(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

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

Remarks

Each of the overloads uses a XmlDictionaryReaderQuotas to prevent Denial of Service (DoS) attacks when reading untrusted data. For more information about using XmlDictionaryReaderQuotas to prevent Denial of Service attacks when reading untrusted data, see Security Considerations for Data.

CreateJsonReader(Byte[], XmlDictionaryReaderQuotas)

Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs

Creates an XmlDictionaryReader that can map buffers encoded with JavaScript Object Notation (JSON) to an XML Infoset.

public static System.Xml.XmlDictionaryReader CreateJsonReader(byte[] buffer, System.Xml.XmlDictionaryReaderQuotas quotas);

Parameters

buffer
Byte[]

The input Byte buffer array from which to read.

quotas
XmlDictionaryReaderQuotas

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

Returns

An XmlDictionaryReader that can process JavaScript Object Notation (JSON) data.

Remarks

This overload does not accept an Encoding parameter. The character encoding (UTF-8, Unicode or Big-Endian Unicode) is auto-detected when the data is read.

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

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

CreateJsonReader(Stream, XmlDictionaryReaderQuotas)

Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs

Creates an XmlDictionaryReader that can map streams encoded with JavaScript Object Notation (JSON) to an XML Infoset.

public static System.Xml.XmlDictionaryReader CreateJsonReader(System.IO.Stream stream, System.Xml.XmlDictionaryReaderQuotas quotas);

Parameters

stream
Stream

The input Stream from which to read.

quotas
XmlDictionaryReaderQuotas

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

Returns

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

Remarks

This overload does not take an Encoding parameter. The character encoding (UTF-8, Unicode or Big-Endian Unicode) is auto-detected when the data is read.

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

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

CreateJsonReader(Byte[], Int32, Int32, XmlDictionaryReaderQuotas)

Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs

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

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

Parameters

buffer
Byte[]

The input Byte buffer array from which to read.

offset
Int32

Starting position from which to read in buffer.

count
Int32

Number of bytes that can be read from buffer.

quotas
XmlDictionaryReaderQuotas

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

Returns

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

Remarks

This overload does not take an Encoding parameter. The character encoding (UTF-8, Unicode or Big-Endian Unicode) is auto-detected when the data is read.

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

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

CreateJsonReader(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs

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

public static System.Xml.XmlDictionaryReader CreateJsonReader(System.IO.Stream stream, System.Text.Encoding? encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose? onClose);
public static System.Xml.XmlDictionaryReader CreateJsonReader(System.IO.Stream stream, System.Text.Encoding encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose onClose);

Parameters

stream
Stream

The input Stream from which to read.

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

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

onClose
OnXmlDictionaryReaderClose

The OnXmlDictionaryReaderClose delegate to call when the reader is closed.

Returns

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

Remarks

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

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

CreateJsonReader(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs
Source:
JsonReaderWriterFactory.cs

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

public static System.Xml.XmlDictionaryReader CreateJsonReader(byte[] buffer, int offset, int count, System.Text.Encoding? encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose? onClose);
public static System.Xml.XmlDictionaryReader CreateJsonReader(byte[] buffer, int offset, int count, System.Text.Encoding encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose onClose);

Parameters

buffer
Byte[]

The input Byte buffer array from which to read.

offset
Int32

Starting position from which to read in buffer.

count
Int32

Number of bytes that can be read from buffer.

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

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

onClose
OnXmlDictionaryReaderClose

The OnXmlDictionaryReaderClose delegate to call when the reader is closed. The default value is null.

Returns

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

Remarks

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

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1