WriteTo Method

MemoryStream.WriteTo Method (Stream)

 

Writes the entire contents of this memory stream to another stream.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

public virtual void WriteTo(
	Stream stream
)

Parameters

stream
Type: System.IO.Stream

The stream to write this memory stream to.

Exception Condition
ArgumentNullException

stream is null.

ObjectDisposedException

The current or target stream is closed.

When the current stream is open, this method is equivalent to calling Stream.Write on the underlying buffer of this stream.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft