BrotliEncoder.TryCompress 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32) |
嘗試將來源位元組區間壓縮成目的地區間。 |
| TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Int32) |
嘗試將來源位元組區間壓縮成目的位元組區間,使用提供的壓縮品質 leven 和編碼器視窗位元。 |
TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32)
嘗試將來源位元組區間壓縮成目的地區間。
public:
static bool TryCompress(ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);
static member TryCompress : ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Shared Function TryCompress (source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean
參數
- source
- ReadOnlySpan<Byte>
一個只讀的位元組範圍,包含可壓縮的來源資料。
- bytesWritten
- Int32
當此方法回傳時,寫入 destination的總位元組數為 。
傳回
true 若壓縮操作成功; false 否則,
適用於
TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Int32)
嘗試將來源位元組區間壓縮成目的位元組區間,使用提供的壓縮品質 leven 和編碼器視窗位元。
public:
static bool TryCompress(ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten, int quality, int window);
public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int quality, int window);
static member TryCompress : ReadOnlySpan<byte> * Span<byte> * int * int * int -> bool
Public Shared Function TryCompress (source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer, quality As Integer, window As Integer) As Boolean
參數
- source
- ReadOnlySpan<Byte>
一個只讀的位元組範圍,包含可壓縮的來源資料。
- bytesWritten
- Int32
當此方法回傳時,寫入 destination的總位元組數為 。
- quality
- Int32
一個數字代表 Brotli 壓縮的品質。 0 是最小值(無壓縮),11 是最大值。
- window
- Int32
一個代表編碼器視窗位元的數字。 最低值是10,最高值是24。
傳回
true 若壓縮操作成功; false 否則,