Share via


MetadataDocument.WriteTo Method

Definition

Overloads

WriteTo(Stream)

Writes the content of the document into the specified stream.

WriteTo(TextWriter, Encoding)

Writes the content of the document into the specified text-writer.

WriteTo(Stream)

Writes the content of the document into the specified stream.

public void WriteTo (System.IO.Stream document);
member this.WriteTo : System.IO.Stream -> unit
Public Sub WriteTo (document As Stream)

Parameters

document
Stream

A Stream that represent the target of the content.

Exceptions

The specified document is a null reference (Nothing in Visual Basic).

The specified document does not supports writing into.

Applies to

WriteTo(TextWriter, Encoding)

Writes the content of the document into the specified text-writer.

public void WriteTo (System.IO.TextWriter writer, System.Text.Encoding encoding = default);
member this.WriteTo : System.IO.TextWriter * System.Text.Encoding -> unit
Public Sub WriteTo (writer As TextWriter, Optional encoding As Encoding = Nothing)

Parameters

writer
TextWriter

A TextWriter that will persist the document's content.

encoding
Encoding

An optional Encoding to use during the persiting of the content; default is UTF8.

Exceptions

The specified writer is a null reference (Nothing in Visual Basic).

Remarks

If an optional encoding is specified, it should match the encoding that was used during the serialization of the content.

Applies to