XmlDictionaryWriter.CreateBinaryWriter Metod

Definition

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt XML-format.

Överlagringar

Name Description
CreateBinaryWriter(Stream)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt XML-format.

CreateBinaryWriter(Stream, IXmlDictionary)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt XML-format.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt XML-format.

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt XML-format.

Kommentarer

Det binära formatet stöder endast en textnod som attributvärde och buffrar därför de värden som skrivs till den för att generera en enskild nod, enligt följande exempelkod.

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

I föregående exempel buffrar koden cirka 1 GB minne, medan den i de andra skrivarna skriver värdena som de tillhandahålls.

CreateBinaryWriter(Stream)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt 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
Public Shared Function CreateBinaryWriter (stream As Stream) As XmlDictionaryWriter

Parametrar

stream
Stream

Dataströmmen att skriva till.

Returer

En instans av XmlDictionaryWriter.

Gäller för

CreateBinaryWriter(Stream, IXmlDictionary)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt 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
Public Shared Function CreateBinaryWriter (stream As Stream, dictionary As IXmlDictionary) As XmlDictionaryWriter

Parametrar

stream
Stream

Dataströmmen att skriva till.

dictionary
IXmlDictionary

Att XmlDictionary använda som delad ordlista.

Returer

En instans av XmlDictionaryWriter.

Gäller för

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt 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
Public Shared Function CreateBinaryWriter (stream As Stream, dictionary As IXmlDictionary, session As XmlBinaryWriterSession) As XmlDictionaryWriter

Parametrar

stream
Stream

Dataströmmen att skriva till.

dictionary
IXmlDictionary

Att XmlDictionary använda som delad ordlista.

Returer

En instans av XmlDictionaryWriter.

Gäller för

CreateBinaryWriter(Stream, IXmlDictionary, XmlBinaryWriterSession, Boolean)

Skapar en instans av XmlDictionaryWriter som skriver WCF-binärt 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
Public Shared Function CreateBinaryWriter (stream As Stream, dictionary As IXmlDictionary, session As XmlBinaryWriterSession, ownsStream As Boolean) As XmlDictionaryWriter

Parametrar

stream
Stream

Strömmen som ska läsas från.

dictionary
IXmlDictionary

Att XmlDictionary använda som delad ordlista.

ownsStream
Boolean

true för att indikera att strömmen stängs av skrivaren när den är klar; annars false.

Returer

En instans av XmlDictionaryWriter.

Gäller för