Condividi tramite


PipelineWriter.Write Method

Definition

Overloads

Write(Object)

Write a single object into the underlying stream.

Write(Object, Boolean)

Write multiple objects to the underlying stream.

Write(Object)

Write a single object into the underlying stream.

public:
 abstract int Write(System::Object ^ obj);
public:
 abstract int Write(Platform::Object ^ obj);
 abstract int Write(winrt::Windows::Foundation::IInspectable const & obj);
public abstract int Write (object obj);
abstract member Write : obj -> int
Public MustOverride Function Write (obj As Object) As Integer

Parameters

obj
Object

The object to add to the stream.

Returns

One, if the write was successful, otherwise; zero if the stream was closed before the object could be written, or if the object was AutomationNull.Value.

Exceptions

The underlying stream is already closed

Remarks

AutomationNull.Value is ignored

Applies to

Write(Object, Boolean)

Write multiple objects to the underlying stream.

public:
 abstract int Write(System::Object ^ obj, bool enumerateCollection);
public:
 abstract int Write(Platform::Object ^ obj, bool enumerateCollection);
 abstract int Write(winrt::Windows::Foundation::IInspectable const & obj, bool enumerateCollection);
public abstract int Write (object obj, bool enumerateCollection);
abstract member Write : obj * bool -> int
Public MustOverride Function Write (obj As Object, enumerateCollection As Boolean) As Integer

Parameters

obj
Object

Object or enumeration to read from.

enumerateCollection
Boolean

If enumerateCollection is true, and obj is an enumeration according to LanguagePrimitives.GetEnumerable, the objects in the enumeration will be unrolled and written separately. Otherwise, obj will be written as a single object.

Returns

The number of objects written.

Exceptions

The underlying stream is already closed

Remarks

If the enumeration contains elements equal to AutomationNull.Value, they are ignored. This can cause the return value to be less than the size of the collection.

Applies to