Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Stream.CopyTo Method (Stream)

Reads all the bytes from the current stream and writes them to the destination stream.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)
public void CopyTo(
	Stream destination
)

Parameters

destination
Type: System.IO.Stream
The stream that will contain the contents of the current stream.
ExceptionCondition
ArgumentNullException

destination is null.

NotSupportedException

The current stream does not support reading.

-or-

destination does not support writing.

ObjectDisposedException

Either the current stream or destination were closed before the CopyTo method was called.

IOException

An I/O error occurred.

Copying begins at the current position in the current stream.

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.