BufferedStream.CopyTo(Stream, Int32) 方法

定義

從目前緩衝資料流讀取位元組,並將其寫入至另一個資料流。

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)

參數

destination
Stream

要將目前緩衝資料流的內容複製到其中的資料流。

bufferSize
Int32

緩衝區的大小。 這個值必須大於零。 預設大小為 81920。

例外狀況

destinationnull

bufferSize 為負值或零。

目前的資料流不支援讀取。

-或-

destination 不支援寫入。

目前資料流或 destination 已經在呼叫 CopyTo(Stream) 方法之前關閉。

發生 I/O 錯誤。

適用於