XmlDictionaryWriter.CreateBinaryWriter XmlDictionaryWriter.CreateBinaryWriter XmlDictionaryWriter.CreateBinaryWriter Method

Definition

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

Overloads

CreateBinaryWriter(Stream) CreateBinaryWriter(Stream) CreateBinaryWriter(Stream)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

CreateBinaryWriter(Stream, IXmlDictionary) CreateBinaryWriter(Stream, IXmlDictionary) CreateBinaryWriter(Stream, IXmlDictionary)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

Remarks

The binary format only supports one text node as the attribute value and therefore buffers the values written to it to emit a single node, as shown in the following sample code.

XmlWriter binarywriter = XmlDictionaryWriter.CreateBinaryWriter(Stream.Null);  
binarywriter.WriteStartAttribute("StartAttribute");  
string largeStr = new string('r', 100000);  
for (int i = 0; i < 10000; i++)   
{  
    binarywriter.WriteValue(largeStr);  
}  
binarywriter.WriteEndAttribute();  

In the previous sample the code buffers about 1 GB of memory, while in the other writers it writes the values as they are provided.

CreateBinaryWriter(Stream) CreateBinaryWriter(Stream) CreateBinaryWriter(Stream)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

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

Parameters

stream
Stream Stream Stream

The stream to write to.

Returns

CreateBinaryWriter(Stream, IXmlDictionary) CreateBinaryWriter(Stream, IXmlDictionary) CreateBinaryWriter(Stream, IXmlDictionary)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateBinaryWriter(System::IO::Stream ^ stream, System::Xml::IXmlDictionary ^ dictionary);
public static System.Xml.XmlDictionaryWriter CreateBinaryWriter (System.IO.Stream stream, System.Xml.IXmlDictionary dictionary);
static member CreateBinaryWriter : System.IO.Stream * System.Xml.IXmlDictionary -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The stream to write to.

dictionary
IXmlDictionary IXmlDictionary IXmlDictionary

The XmlDictionary to use as the shared dictionary.

Returns

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateBinaryWriter(System::IO::Stream ^ stream, System::Xml::IXmlDictionary ^ dictionary, System::Xml::XmlBinaryWriterSession ^ session);
public static System.Xml.XmlDictionaryWriter CreateBinaryWriter (System.IO.Stream stream, System.Xml.IXmlDictionary dictionary, System.Xml.XmlBinaryWriterSession session);
static member CreateBinaryWriter : System.IO.Stream * System.Xml.IXmlDictionary * System.Xml.XmlBinaryWriterSession -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The stream to write to.

dictionary
IXmlDictionary IXmlDictionary IXmlDictionary

The XmlDictionary to use as the shared dictionary.

Returns

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean) CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Creates an instance of XmlDictionaryWriter that writes WCF binary XML format.

public:
 static System::Xml::XmlDictionaryWriter ^ CreateBinaryWriter(System::IO::Stream ^ stream, System::Xml::IXmlDictionary ^ dictionary, System::Xml::XmlBinaryWriterSession ^ session, bool ownsStream);
public static System.Xml.XmlDictionaryWriter CreateBinaryWriter (System.IO.Stream stream, System.Xml.IXmlDictionary dictionary, System.Xml.XmlBinaryWriterSession session, bool ownsStream);
static member CreateBinaryWriter : System.IO.Stream * System.Xml.IXmlDictionary * System.Xml.XmlBinaryWriterSession * bool -> System.Xml.XmlDictionaryWriter

Parameters

stream
Stream Stream Stream

The stream from which to read.

dictionary
IXmlDictionary IXmlDictionary IXmlDictionary

The XmlDictionary to use as the shared dictionary.

ownsStream
Boolean Boolean Boolean

true to indicate that the stream is closed by the writer when done; otherwise false.

Returns

Applies to