Stream. Copy To(Stream, Int32) Method
Reads the bytes from the current buffered stream and writes them to another stream.
public: override void CopyTo(System::IO::Stream ^ destination, int bufferSize);
public override void CopyTo (System.IO.Stream destination, int bufferSize);
override this.CopyTo : System.IO.Stream * int -> unit
Public Overrides Sub CopyTo (destination As Stream, bufferSize As Integer)
The stream to which the contents of the current buffered stream will be copied.
The size of the buffer. This value must be greater than zero. The default size is 81920.
bufferSize is negative or zero.
The current stream does not support reading.
destination does not support writing.
Either the current stream or
destination was closed before the CopyTo(Stream) method was called.
An I/O error occurred.