Stream.CopyTo Method (Stream, Int32)
Reads all the bytes from the current stream and writes them to a destination stream, using a specified buffer size.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Sub CopyTo ( _ destination As Stream, _ bufferSize As Integer _ )
public void CopyTo( Stream destination, int bufferSize )
destination is nulla null reference (Nothing in Visual Basic).
bufferSize is negative or zero.
The current stream does not support reading.
destination does not support writing.
Either the current stream or destination were closed before the CopyTo method was called.
An I/O error occurred.
Copying begins at the current position in the current stream.
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.