Stream. Copy To(Stream, Int32) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads the bytes from the current memory stream and writes them to another stream, using a specified buffer size.
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 memory stream will be copied.
The size of the buffer. This value must be greater than zero. The default size is 81920.
bufferSize is not a positive number.
Either the underlying memory stream or the
destination stream is closed.
The underlying memory stream is unreadable.
destination stream is unwritable.