CapyKit Documentation
  • Introduction
  • Getting Started
  • API Reference
    • CapyKit
      • CapyEventArgs
      • CapyEventHandler
      • CapyEventReporter
      • Color
      • EncryptedValue<T>
      • EventLevel
      • IPasswordAlgorithm
      • NamedColor
      • Password
      • Pbkdf2Algorithm
      • PoolItem<T>
      • Pool<T>
      • PropertyComparer<T, U>
    • CapyKit.Attributes
      • EnumerationAttribute<T>
      • EnumerationDescriptionAttribute
      • ValueFormatAttribute
    • CapyKit.Enumerations
      • MeasurementSystem
    • CapyKit.Extensions
      • EnumerationExtensions
      • LINQExtensions
      • ObjectExtensions
      • StringExtensions
    • CapyKit.Helpers
      • CalculationHelper
      • CompressionHelper
      • EncryptionHelper
      • IEncryptionAlgorithm
      • KeyHelper
      • LanguageHelper
      • SecurityHelper
      • SerializationHelper
      • SettingsHelper
      • ValidCharacterCollection
Search Results for

    Show / Hide Table of Contents
    • Introduction
    • Getting Started
    • API Reference
      • CapyKit
        • CapyEventArgs
        • CapyEventHandler
        • CapyEventReporter
        • Color
        • EncryptedValue<T>
        • EventLevel
        • IPasswordAlgorithm
        • NamedColor
        • Password
        • Pbkdf2Algorithm
        • PoolItem<T>
        • Pool<T>
        • PropertyComparer<T, U>
      • CapyKit.Attributes
        • EnumerationAttribute<T>
        • EnumerationDescriptionAttribute
        • ValueFormatAttribute
      • CapyKit.Enumerations
        • MeasurementSystem
      • CapyKit.Extensions
        • EnumerationExtensions
        • LINQExtensions
        • ObjectExtensions
        • StringExtensions
      • CapyKit.Helpers
        • CalculationHelper
        • CompressionHelper
        • EncryptionHelper
        • IEncryptionAlgorithm
        • KeyHelper
        • LanguageHelper
        • SecurityHelper
        • SerializationHelper
        • SettingsHelper
        • ValidCharacterCollection

    Class CompressionHelper

    A class that contains methods for managing data compression.

    Inheritance
    object
    CompressionHelper
    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 gzip format.

    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 base64 encoding.

    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 T typed object.

    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 base64 encoded gzip string.

    Returns
    Type Description
    T

    A T typed object.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    In this article
    Back to top Generated by DocFX