Show / Hide Table of Contents

Interface ICompressionUtility

Useful utility interface for quickly and easily compressing/decompressing data.

Namespace: GlitchedPolygons.Services.CompressionUtility
Assembly: GlitchedPolygons.Services.CompressionUtility.dll
Syntax
public interface ICompressionUtility

Methods

Compress(byte[], CompressionSettings)

Compresses the specified bytes using the provided CompressionSettings.

Declaration
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
byte[]

The compressed byte[] array.

Compress(string, Encoding)

Compresses the specified string.

Declaration
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
string

The compressed string.

Decompress(byte[], CompressionSettings)

Decompresses the specified bytes using the CompressionSettings that have been used to originally compress the bytes.

Declaration
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
byte[]

The decompressed bytes[].

Decompress(string, Encoding)

Decompresses the specified compressed string.

Declaration
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. Make sure to use the same

Returns
Type Description
string

The decompressed string

Back to top Generated by DocFX