Stream::CopyTo Method (Stream, Int32)
Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.
Assembly: mscorlib (in mscorlib.dll)
destination is nullptr.
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.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)