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.

public virtual void WriteTo (Stream stream)

Parameters

stream
The System.IO.Stream to write the current memory stream to.

Exceptions

TypeReason
ArgumentNullExceptionstream is null.
ObjectDisposedExceptionThe current or target stream is closed.

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.

Requirements

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