語言

BrotliEncoder.TryCompress 方法

定義

多載

名稱 Description
TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32)

嘗試將來源位元組區間壓縮成目的地區間。

TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Int32)

嘗試將來源位元組區間壓縮成目的位元組區間,使用提供的壓縮品質 leven 和編碼器視窗位元。

TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32)

來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs

嘗試將來源位元組區間壓縮成目的地區間。

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>

一個只讀的位元組範圍,包含可壓縮的來源資料。

destination
Span<Byte>

當此方法回傳時,會顯示壓縮資料儲存的位元組區段。

bytesWritten
Int32

當此方法回傳時,寫入 destination的總位元組數為 。

傳回

true 若壓縮操作成功; false 否則,

適用於

TryCompress(ReadOnlySpan<Byte>, Span<Byte>, Int32, Int32, Int32)

來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs
來源:
BrotliEncoder.cs

嘗試將來源位元組區間壓縮成目的位元組區間,使用提供的壓縮品質 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>

一個只讀的位元組範圍,包含可壓縮的來源資料。

destination
Span<Byte>

當此方法回傳時,會顯示壓縮資料儲存的位元組區段。

bytesWritten
Int32

當此方法回傳時,寫入 destination的總位元組數為 。

quality
Int32

一個數字代表 Brotli 壓縮的品質。 0 是最小值(無壓縮),11 是最大值。

window
Int32

一個代表編碼器視窗位元的數字。 最低值是10,最高值是24。

傳回

true 若壓縮操作成功; false 否則,

適用於