Partilhar via


XmlDictionaryWriter.CreateBinaryWriter Método

Definição

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

Sobrecargas

CreateBinaryWriter(Stream)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

CreateBinaryWriter(Stream, IXmlDictionary)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

Comentários

O formato binário dá suporte apenas a um nó de texto como o valor do atributo e, portanto, armazena em buffer os valores gravados nele para emitir um único nó, conforme mostrado no código de exemplo a seguir.

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();  

No exemplo anterior, o código armazena em buffer cerca de 1 GB de memória, enquanto nos outros gravadores ele grava os valores conforme eles são fornecidos.

CreateBinaryWriter(Stream)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

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
Public Shared Function CreateBinaryWriter (stream As Stream) As XmlDictionaryWriter

Parâmetros

stream
Stream

O fluxo para gravação.

Retornos

XmlDictionaryWriter

Uma instância de XmlDictionaryWriter.

Aplica-se a

CreateBinaryWriter(Stream, IXmlDictionary)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

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);
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
Public Shared Function CreateBinaryWriter (stream As Stream, dictionary As IXmlDictionary) As XmlDictionaryWriter

Parâmetros

stream
Stream

O fluxo para gravação.

dictionary
IXmlDictionary

O XmlDictionary a ser usado como o dicionário compartilhado.

Retornos

XmlDictionaryWriter

Uma instância de XmlDictionaryWriter.

Aplica-se a

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

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);
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
Public Shared Function CreateBinaryWriter (stream As Stream, dictionary As IXmlDictionary, session As XmlBinaryWriterSession) As XmlDictionaryWriter

Parâmetros

stream
Stream

O fluxo para gravação.

dictionary
IXmlDictionary

O XmlDictionary a ser usado como o dicionário compartilhado.

Retornos

XmlDictionaryWriter

Uma instância de XmlDictionaryWriter.

Aplica-se a

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Cria uma instância do XmlDictionaryWriter que grava o formato XML binário do WCF.

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);
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
Public Shared Function CreateBinaryWriter (stream As Stream, dictionary As IXmlDictionary, session As XmlBinaryWriterSession, ownsStream As Boolean) As XmlDictionaryWriter

Parâmetros

stream
Stream

O fluxo do qual ler.

dictionary
IXmlDictionary

O XmlDictionary a ser usado como o dicionário compartilhado.

ownsStream
Boolean

true para indicar que o fluxo é fechado pelo gravador quando concluído; caso contrário, false.

Retornos

XmlDictionaryWriter

Uma instância de XmlDictionaryWriter.

Aplica-se a