JsonReaderWriterFactory.CreateJsonWriter Method (Stream, Encoding, Boolean)

Creates an XmlDictionaryWriter that writes data encoded with JSON to a stream with a specified character encoding and that specifies whether the output stream is closed by the writer when it is done.

Namespace:  System.Runtime.Serialization.Json
Assembly:  System.Runtime.Serialization.Json (in System.Runtime.Serialization.Json.dll)

public static XmlDictionaryWriter CreateJsonWriter(
	Stream stream,
	Encoding encoding,
	bool ownsStream
)

Parameters

stream
Type: System.IO.Stream
The output Stream for the JSON writer.
encoding
Type: System.Text.Encoding
The Encoding that specifies the character encoding used by the writer. The default encoding is UTF-8.
ownsStream
Type: System.Boolean
If true, the output stream is closed by the writer when done; otherwise, false. The default value is true.

Return Value

Type: System.Xml.XmlDictionaryWriter
An XmlDictionaryWriter that writes data encoded with JSON to the stream from an XML Infoset.

ExceptionCondition
ArgumentNullException

stream or encoding is null.

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: