Mono Class Library: System.IO.MemoryStream Overview | Members

System.IO.MemoryStream.WriteTo Method

Writes the entire contents of the current System.IO.MemoryStream instance to a specified stream. [Edit]

public virtual void WriteTo (Stream stream)

Parameters

stream
The System.IO.Stream to write the current memory stream to. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionstream is null. [Edit]
ObjectDisposedExceptionThe current or target stream is closed. [Edit]

Remarks

Note: This method is equivalent to calling stream.Write(this.GetBuffer(), 0, this.GetBuffer().Length) and passing in the underlying buffer of the current instance.

Operation
As described above.

[Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0