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
Public Overridable Sub WriteTo (stream As Stream)

参数

stream
Stream

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

例外

streamnullstream is null.

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

注解

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

适用于