Condividi tramite


XmlDictionaryWriter.CreateBinaryWriter Metodo

Definizione

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario WCF.

Overload

CreateBinaryWriter(Stream)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario WCF.

CreateBinaryWriter(Stream, IXmlDictionary)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario WCF.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario WCF.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario WCF.

Commenti

Il formato binario supporta solo un nodo di testo come valore dell'attributo e pertanto memorizza nel buffer i valori scritti in esso per creare un solo nodo, come mostrato nell'esempio di codice seguente.

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

Nell'esempio precedente il codice memorizza nel buffer circa 1 GB di memoria, mentre negli altri writer scrive i valori così come vengono forniti.

CreateBinaryWriter(Stream)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario 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

Parametri

stream
Stream

Flusso in cui scrivere.

Restituisce

XmlDictionaryWriter

Istanza di XmlDictionaryWriter.

Si applica a

CreateBinaryWriter(Stream, IXmlDictionary)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario 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

Parametri

stream
Stream

Flusso in cui scrivere.

dictionary
IXmlDictionary

XmlDictionary da utilizzare come dizionario condiviso.

Restituisce

XmlDictionaryWriter

Istanza di XmlDictionaryWriter.

Si applica a

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario 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

Parametri

stream
Stream

Flusso in cui scrivere.

dictionary
IXmlDictionary

XmlDictionary da utilizzare come dizionario condiviso.

Restituisce

XmlDictionaryWriter

Istanza di XmlDictionaryWriter.

Si applica a

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Crea un'istanza di XmlDictionaryWriter che scrive in formato XML binario 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

Parametri

stream
Stream

Il flusso da cui eseguire la lettura.

dictionary
IXmlDictionary

XmlDictionary da utilizzare come dizionario condiviso.

ownsStream
Boolean

true per indicare che il flusso viene chiuso al termine dal writer; in caso contrario, false.

Restituisce

XmlDictionaryWriter

Istanza di XmlDictionaryWriter.

Si applica a