Class CompressionHelper

Namespace
CapyKit.Helpers
Assembly
CapyKit.dll

A class that contains methods for managing data compression.

public static class CompressionHelper
Inheritance
CompressionHelper
Inherited Members

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.

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.

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.

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.