Partager via


XmlDictionaryWriter.CreateBinaryWriter Méthode

Définition

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire WCF.

Surcharges

CreateBinaryWriter(Stream)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire WCF.

CreateBinaryWriter(Stream, IXmlDictionary)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire WCF.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire WCF.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire WCF.

Remarques

Le format binaire ne prend en charge qu'un nœud de texte comme valeur d'attribut et par conséquent met en mémoire tampon les valeurs qui y sont écrites pour émettre un nœud unique, comme présenté dans l'exemple de code suivant.

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

Dans l'exemple précédent, le code met en mémoire tampon environ 1 Go de mémoire, alors que dans les autres writers, il écrit les valeurs telles qu'elles sont fournies.

CreateBinaryWriter(Stream)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire 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

Paramètres

stream
Stream

Le flux dans lequel écrire.

Retours

XmlDictionaryWriter

Instance de XmlDictionaryWriter.

S’applique à

CreateBinaryWriter(Stream, IXmlDictionary)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire 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

Paramètres

stream
Stream

Le flux dans lequel écrire.

dictionary
IXmlDictionary

XmlDictionary à utiliser comme dictionnaire partagé.

Retours

XmlDictionaryWriter

Instance de XmlDictionaryWriter.

S’applique à

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire 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

Paramètres

stream
Stream

Le flux dans lequel écrire.

dictionary
IXmlDictionary

XmlDictionary à utiliser comme dictionnaire partagé.

Retours

XmlDictionaryWriter

Instance de XmlDictionaryWriter.

S’applique à

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Crée une instance de XmlDictionaryWriter qui écrit le format XML binaire 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

Paramètres

stream
Stream

Le flux de données à partir duquel effectuer la lecture.

dictionary
IXmlDictionary

XmlDictionary à utiliser comme dictionnaire partagé.

ownsStream
Boolean

true pour indiquer que le flux est fermé par le writer lorsqu'il est terminé ; sinon false.

Retours

XmlDictionaryWriter

Instance de XmlDictionaryWriter.

S’applique à