MemoryStream.WriteTo(Stream) 方法

定义

将此内存流的整个内容写入到另一个流中。Writes the entire contents of this memory stream to another stream.

public:
 virtual void WriteTo(System::IO::Stream ^ stream);
public virtual void WriteTo (System.IO.Stream stream);
abstract member WriteTo : System.IO.Stream -> unit
override this.WriteTo : System.IO.Stream -> unit

参数

stream
Stream

要写入此内存流的流。The stream to write this memory stream to.

异常

streamnullstream is null.

当前流或目标流已关闭。The current or target stream is closed.

注解

当当前流处于打开状态时,此方法等效于调用此流的基础缓冲区上的 Stream.WriteWhen the current stream is open, this method is equivalent to calling Stream.Write on the underlying buffer of this stream.

适用于

另请参阅