Class CompressionHelper
A class that contains methods for managing data compression.
Namespace: CapyKit.Helpers
Assembly: CapyKit.dll
Syntax
public static class CompressionHelper
Methods
Compress(object)
Compresses a given object using the gzip algorithm.
Declaration
public static byte[] Compress(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object. |
Returns
| Type | Description |
|---|---|
| byte[] | A byte array representing the compressed object in |
CompressToString(object)
Compresses a given object to a string using base64 encoding of gzip format.
Declaration
public static string CompressToString(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object. |
Returns
| Type | Description |
|---|---|
| string | A string in |
DecompressToString(string)
Decompresses the given base64 string in gzip format.
Declaration
public static string DecompressToString(string compressed)
Parameters
| Type | Name | Description |
|---|---|---|
| string | compressed | The compressed string. |
Returns
| Type | Description |
|---|---|
| string | A decomressed string. |
Decompress<T>(byte[])
Decompresses a given compressed gzip byte stream.
Declaration
public static T Decompress<T>(byte[] byteStream)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | byteStream | The compressed byte stream. |
Returns
| Type | Description |
|---|---|
| T | A |
Type Parameters
| Name | Description |
|---|---|
| T | Generic type parameter. |
Decompress<T>(string)
Decompresses a given base64 encoded string of gzip format.
Declaration
public static T Decompress<T>(string encodedString)
Parameters
| Type | Name | Description |
|---|---|---|
| string | encodedString | The |
Returns
| Type | Description |
|---|---|
| T | A |
Type Parameters
| Name | Description |
|---|---|
| T | Generic type parameter. |