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.Write資料流程的基礎緩衝區上呼叫。When the current stream is open, this method is equivalent to calling Stream.Write on the underlying buffer of this stream.

適用於

另請參閱