BrotliStream.Write 方法

定義

多載

Write(ReadOnlySpan<Byte>)

將位元組序列從唯讀位元組範圍寫入至目前 Brotli 資料流,並依寫入的位元組數將此 Brotli 資料流中目前位置往前移。

Write(Byte[], Int32, Int32)

從指定的位元組陣列將壓縮的位元組寫入基礎資料流。

Write(ReadOnlySpan<Byte>)

來源:
BrotliStream.Compress.cs
來源:
BrotliStream.Compress.cs
來源:
BrotliStream.Compress.cs

將位元組序列從唯讀位元組範圍寫入至目前 Brotli 資料流,並依寫入的位元組數將此 Brotli 資料流中目前位置往前移。

public:
 override void Write(ReadOnlySpan<System::Byte> buffer);
public override void Write (ReadOnlySpan<byte> buffer);
override this.Write : ReadOnlySpan<byte> -> unit
Public Overrides Sub Write (buffer As ReadOnlySpan(Of Byte))

參數

buffer
ReadOnlySpan<Byte>

記憶體區域。 這個方法會將此區域內容複製到目前 Brotli 資料流。

備註

CanWrite使用屬性來判斷目前的實例是否支援寫入。 System.IO.Compression.BrotliStream.WriteAsync使用方法,以異步方式寫入目前的數據流。

如果寫入作業成功,Brotli 數據流內的位置會依寫入的位元元組數目前進。 如果發生例外狀況,Brotli 數據流內的位置會保持不變。

適用於

Write(Byte[], Int32, Int32)

來源:
BrotliStream.Compress.cs
來源:
BrotliStream.Compress.cs
來源:
BrotliStream.Compress.cs

從指定的位元組陣列將壓縮的位元組寫入基礎資料流。

public:
 override void Write(cli::array <System::Byte> ^ buffer, int offset, int count);
public override void Write (byte[] buffer, int offset, int count);
override this.Write : byte[] * int * int -> unit
Public Overrides Sub Write (buffer As Byte(), offset As Integer, count As Integer)

參數

buffer
Byte[]

包含要壓縮之資料的緩衝區。

offset
Int32

buffer 中的位元組位移,即讀取位元組的來源位置。

count
Int32

寫入的最大位元組數。

例外狀況

無法執行寫入作業,因為資料流已關閉。

適用於