Class CompressionHelper

Namespace: CapyKit.Helpers
Assembly: CapyKit.dll

A class that contains methods for managing data compression.

public static class CompressionHelper

Inheritance

object ← CompressionHelper

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Extension Methods

ObjectExtensions.UpdateProperties(object, object)

Methods

Compress(object)

Compresses a given object using the gzip algorithm.

public static byte[] Compress(object obj)

Parameters

obj object

The object.

Returns

byte[]

A byte array representing the compressed object in gzip format.

CompressToString(object)

Compresses a given object to a string using base64 encoding of gzip format.

public static string CompressToString(object obj)

Parameters

obj object

The object.

Returns

string

A string in base64 encoding.

Decompress<T>(string)

Decompresses a given base64 encoded string of gzip format.

public static T Decompress<T>(string encodedString)

Parameters

encodedString string

The base64 encoded gzip string.

Returns

T

A T typed object.

Type Parameters

T

Generic type parameter.

Decompress<T>(byte[])

Decompresses a given compressed gzip byte stream.

public static T Decompress<T>(byte[] byteStream)

Parameters

byteStream byte[]

The compressed byte stream.

Returns

T

A T typed object.

Type Parameters

T

Generic type parameter.

DecompressToString(string)

Decompresses the given base64 string in gzip format.

public static string DecompressToString(string compressed)

Parameters

compressed string

The compressed string.

Returns

string

A decomressed string.