Class CompressionHelper
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
objobjectThe object.
Returns
- byte[]
A byte array representing the compressed object in
gzipformat.
CompressToString(object)
Compresses a given object to a string using base64 encoding of gzip format.
public static string CompressToString(object obj)
Parameters
objobjectThe object.
Returns
- string
A string in
base64encoding.
DecompressToString(string)
Decompresses the given base64 string in gzip format.
public static string DecompressToString(string compressed)
Parameters
compressedstringThe 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
byteStreambyte[]The compressed byte stream.
Returns
- T
A
Ttyped object.
Type Parameters
TGeneric type parameter.
Decompress<T>(string)
Decompresses a given base64 encoded string of gzip format.
public static T Decompress<T>(string encodedString)
Parameters
encodedStringstringThe
base64encodedgzipstring.
Returns
- T
A
Ttyped object.
Type Parameters
TGeneric type parameter.