BrotliEncoder.TryCompress 方法

定義

多載

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

嘗試將來源位元組範圍壓縮為目的地範圍。

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

使用提供的壓縮品質層級與編碼器視窗位元,嘗試將來源位元組範圍壓縮為目的地位元組範圍。

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

來源:
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

使用提供的壓縮品質層級與編碼器視窗位元,嘗試將來源位元組範圍壓縮為目的地位元組範圍。

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,而最大值是 is 24。

傳回

若壓縮作業成功則為 true;否則為 false

適用於