BrotliStream.Write 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Write(ReadOnlySpan<Byte>) |
從只讀位元組區間寫入一串位元組到目前 Brotli 串流,並依寫入位元組數將目前位置前進。 |
| Write(Byte[], Int32, Int32) |
從指定的位元組陣列將壓縮的位元組寫入底層串流。 |
Write(ReadOnlySpan<Byte>)
從只讀位元組區間寫入一串位元組到目前 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)
從指定的位元組陣列將壓縮的位元組寫入底層串流。
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
最大可寫入位元組數。
例外狀況
寫入操作無法執行,因為串流是封閉的。