StreamCopyTo Method (Stream) |
Reads the bytes from the current stream and writes them to the destination stream.
Namespace: System.IOAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public void CopyTo(
Stream destination
)
Parameters
- destination
- Type: System.IOStream
The stream that will contain the contents of the current stream.
Exceptions Exception | Condition |
---|
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(Stream) method was called. |
IOException | An I/O error occurred. |
See Also