Show / Hide Table of Contents

Class BrotliUtilityAsync

Brotli implementation of the ICompressionUtilityAsync interface.

Implements the ICompressionUtilityAsync interface. ICompressionUtilityAsync
Inheritance
object
BrotliUtilityAsync
Implements
ICompressionUtilityAsync
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: GlitchedPolygons.Services.CompressionUtility
Assembly: GlitchedPolygons.Services.CompressionUtility.dll
Syntax
public class BrotliUtilityAsync : ICompressionUtilityAsync

Methods

Compress(byte[], CompressionSettings)

Asynchronously compresses the specified bytes using BrotliStream and the provided CompressionSettings.

Declaration
public Task<byte[]> Compress(byte[] bytes, CompressionSettings compressionSettings)
Parameters
Type Name Description
byte[] bytes

The byte[] array to compress.

CompressionSettings compressionSettings

The desired compression settings.

Returns
Type Description
Task<byte[]>

The compressed byte[] array; null if the input data was null; an empty array if the input array was also empty.

Compress(string, Encoding)

Asynchronously compresses the specified string using Brotli.

Declaration
public Task<string> Compress(string text, Encoding encoding = null)
Parameters
Type Name Description
string text

The string to compress.

Encoding encoding

The encoding to use. Can be null; UTF8 will be used in that case.

Returns
Type Description
Task<string>

The compressed string.

Decompress(byte[], CompressionSettings)

Asynchronously decompresses the specified bytes with Brotli using the CompressionSettings that have been used to originally compress the bytes.

Declaration
public Task<byte[]> Decompress(byte[] compressedBytes, CompressionSettings compressionSettings)
Parameters
Type Name Description
byte[] compressedBytes

The compressed byte[] array that you want to decompress.

CompressionSettings compressionSettings

The CompressionSettings that have been used to compress the bytes.

Returns
Type Description
Task<byte[]>

The decompressed bytes[].

Decompress(string, Encoding)

Asynchronously decompresses the specified compressed string using Brotli.

Declaration
public Task<string> Decompress(string compressedString, Encoding encoding = null)
Parameters
Type Name Description
string compressedString

The compressed string to decompress.

Encoding encoding

The encoding to use. Can be null; UTF8 will be used in that case.

Returns
Type Description
Task<string>

The decompressed string.

Implements

ICompressionUtilityAsync
Back to top Generated by DocFX