This topic has not yet been rated - Rate this topic

JsonReaderWriterFactory Class

Produces instances of XmlDictionaryReader that can read data encoded with JavaScript Object Notation (JSON) from a stream or buffer and map it to an XML Infoset and instances of XmlDictionaryWriter that can map an XML Infoset to JSON and write JSON-encoded data to a stream.

System.Object
  System.Runtime.Serialization.Json.JsonReaderWriterFactory

Namespace:  System.Runtime.Serialization.Json
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)
public static class JsonReaderWriterFactory
  Name Description
Public method Static member CreateJsonReader(Byte[], XmlDictionaryReaderQuotas) Creates an XmlDictionaryReader that can map buffers encoded with JavaScript Object Notation (JSON) to an XML Infoset.
Public method Static member CreateJsonReader(Stream, XmlDictionaryReaderQuotas) Creates an XmlDictionaryReader that can map streams encoded with JavaScript Object Notation (JSON) to an XML Infoset.
Public method Static member 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.
Public method Static member 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.
Public method Static member 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.
Public method Static member CreateJsonWriter(Stream) Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream.
Public method Static member CreateJsonWriter(Stream, Encoding) Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding.
Public method Static member CreateJsonWriter(Stream, Encoding, Boolean) Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding.
Top

processes JSON messages using a mapping between JSON data and the XML Infoset. Normally, this mapping is hidden from view. However, in some advanced scenarios it may be necessary to manually convert between JSON and XML. In this case, the JsonReaderWriterFactory class can be used to create the necessary XML readers and writers. Note that not every XML Infoset element can be mapped to JSON. For more information about mapping, see JSON Serialization.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Assembly location
The type was on System.ServiceModel.Web.dll on 3.5; it was moved to System.Runtime.Serialization.dll on 4.0.
wrong assembly
This type seems to be in the System.ServiceModel.Web assembly and not in the System.Runtime.Serialization assembly like mentioned above $0(Not true for Framework 4.0...  maybe true for Framework 3.5, but then again, then help page for 3.5 does say System.ServiceModel.Web)$0