write_to_stream_sync


Description:

[ Version ( since = "3.0" ) ]
public virtual ssize_t write_to_stream_sync (Stream stream, Cancellable? cancellable = null) throws Error

Writes the content of this to stream in a machine-independent format appropriate for the data.

It should be possible to construct an equivalent data wrapper object later by passing this stream to construct_from_stream_sync.

<note> <para> This function may block even if the given output stream does not. For example, the content may have to be fetched across a network before it can be written to stream. </para> </note>

Parameters:

this

a DataWrapper

stream

a Stream for output

cancellable

optional Cancellable object, or null

Returns:

the number of bytes written, or -1 on error