JsonReaderWriterFactory.CreateJsonWriter JsonReaderWriterFactory.CreateJsonWriter JsonReaderWriterFactory.CreateJsonWriter Method

Definition

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream.

Overloads

CreateJsonWriter(Stream) CreateJsonWriter(Stream) CreateJsonWriter(Stream)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream.

CreateJsonWriter(Stream, Encoding) CreateJsonWriter(Stream, Encoding) CreateJsonWriter(Stream, Encoding)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding.

CreateJsonWriter(Stream, Encoding, Boolean) CreateJsonWriter(Stream, Encoding, Boolean) CreateJsonWriter(Stream, Encoding, Boolean)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding.

CreateJsonWriter(Stream, Encoding, Boolean, Boolean) CreateJsonWriter(Stream, Encoding, Boolean, Boolean) CreateJsonWriter(Stream, Encoding, Boolean, Boolean)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character.

CreateJsonWriter(Stream, Encoding, Boolean, Boolean, String) CreateJsonWriter(Stream, Encoding, Boolean, Boolean, String) CreateJsonWriter(Stream, Encoding, Boolean, Boolean, String)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character.

Remarks

The CreateJsonWriter static method returns an instance of an XmlDictionaryWriter that can map an XML Infoset to a JSON stream. The XmlDictionaryWriter is not guaranteed to produce valid JSON. If it is used in a way not supported by the JSON-XML mapping, it may either throw an exception or write an invalid JSON document.

CreateJsonWriter(Stream) CreateJsonWriter(Stream) CreateJsonWriter(Stream)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateJsonWriter(System::IO::Stream ^ stream);
public static System.Xml.XmlDictionaryWriter CreateJsonWriter (System.IO.Stream stream);
static member CreateJsonWriter : System.IO.Stream -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The output Stream for the JSON writer.

Returns

An XmlDictionaryWriter that writes data encoded with JSON to the stream based on an XML Infoset.

Remarks

The default character encoding is UTF-8. When the writer is closed, the stream is closed as well.

CreateJsonWriter(Stream, Encoding) CreateJsonWriter(Stream, Encoding) CreateJsonWriter(Stream, Encoding)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateJsonWriter(System::IO::Stream ^ stream, System::Text::Encoding ^ encoding);
public static System.Xml.XmlDictionaryWriter CreateJsonWriter (System.IO.Stream stream, System.Text.Encoding encoding);
static member CreateJsonWriter : System.IO.Stream * System.Text.Encoding -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The output Stream for the JSON writer.

encoding
Encoding Encoding Encoding

The Encoding that specifies the character encoding used by the writer. The default encoding is UTF-8.

Returns

An XmlDictionaryWriter that writes data encoded with JSON to the stream based on an XML Infoset.

Remarks

When the writer is closed, the stream is closed as well.

CreateJsonWriter(Stream, Encoding, Boolean) CreateJsonWriter(Stream, Encoding, Boolean) CreateJsonWriter(Stream, Encoding, Boolean)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateJsonWriter(System::IO::Stream ^ stream, System::Text::Encoding ^ encoding, bool ownsStream);
public static System.Xml.XmlDictionaryWriter CreateJsonWriter (System.IO.Stream stream, System.Text.Encoding encoding, bool ownsStream);
static member CreateJsonWriter : System.IO.Stream * System.Text.Encoding * bool -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The output Stream for the JSON writer.

encoding
Encoding Encoding Encoding

The Encoding that specifies the character encoding used by the writer. The default encoding is UTF-8.

ownsStream
Boolean Boolean Boolean

If true, the output stream is closed by the writer when done; otherwise false. The default value is true.

Returns

An XmlDictionaryWriter that writes data encoded with JSON to the stream based on an XML Infoset.

CreateJsonWriter(Stream, Encoding, Boolean, Boolean) CreateJsonWriter(Stream, Encoding, Boolean, Boolean) CreateJsonWriter(Stream, Encoding, Boolean, Boolean)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateJsonWriter(System::IO::Stream ^ stream, System::Text::Encoding ^ encoding, bool ownsStream, bool indent);
public static System.Xml.XmlDictionaryWriter CreateJsonWriter (System.IO.Stream stream, System.Text.Encoding encoding, bool ownsStream, bool indent);
static member CreateJsonWriter : System.IO.Stream * System.Text.Encoding * bool * bool -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The output Stream for the JSON writer.

encoding
Encoding Encoding Encoding

The Encoding that specifies the character encoding used by the writer. The default encoding is UTF-8.

ownsStream
Boolean Boolean Boolean

If true, the output stream is closed by the writer when done; otherwise false. The default value is true.

indent
Boolean Boolean Boolean

If true, the output uses multiline format, indenting each level properly; otherwise, false.

Returns

An XmlDictionaryWriter that writes data encoded with JSON to the stream based on an XML Infoset.

CreateJsonWriter(Stream, Encoding, Boolean, Boolean, String) CreateJsonWriter(Stream, Encoding, Boolean, Boolean, String) CreateJsonWriter(Stream, Encoding, Boolean, Boolean, String)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateJsonWriter(System::IO::Stream ^ stream, System::Text::Encoding ^ encoding, bool ownsStream, bool indent, System::String ^ indentChars);
public static System.Xml.XmlDictionaryWriter CreateJsonWriter (System.IO.Stream stream, System.Text.Encoding encoding, bool ownsStream, bool indent, string indentChars);
static member CreateJsonWriter : System.IO.Stream * System.Text.Encoding * bool * bool * string -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The output Stream for the JSON writer.

encoding
Encoding Encoding Encoding

The Encoding that specifies the character encoding used by the writer. The default encoding is UTF-8.

ownsStream
Boolean Boolean Boolean

If true, the output stream is closed by the writer when done; otherwise false. The default value is true.

indent
Boolean Boolean Boolean

If true, the output uses multiline format, indenting each level properly; otherwise, false.

indentChars
String String String

The string used to indent each level.

Returns

An XmlDictionaryWriter that writes data encoded with JSON to the stream based on an XML Infoset.

Applies to