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 SerializationHelper

    Inheritance
    object
    SerializationHelper
    Namespace: CapyKit.Helpers
    Assembly: CapyKit.dll
    Syntax
    public static class SerializationHelper

    Methods

    Deserialize<T>(byte[])

    Deserializes an object to a given T type.

    Declaration
    public static T Deserialize<T>(byte[] bytes)
    Parameters
    Type Name Description
    byte[] bytes

    The byte array representing a T object.

    Returns
    Type Description
    T

    A T object.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Exceptions
    Type Condition
    FormatException

    Thrown when the format of the byte array is incorrect.

    Deserialize<T>(Stream)

    Deserializes an object to a given T type.

    Declaration
    public static T Deserialize<T>(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The steam.

    Returns
    Type Description
    T

    A T object.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Exceptions
    Type Condition
    FormatException

    Thrown when the format of an input is incorrect.

    Deserialize<T>(string)

    Deserializes a JSON encoded string to the given T.

    Declaration
    public static T Deserialize<T>(string str)
    Parameters
    Type Name Description
    string str

    The JSON encoded string representing a T object.

    Returns
    Type Description
    T

    A T object.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    SerializeToBytes(object)

    Serializes an object to a byte array.

    Declaration
    public static byte[] SerializeToBytes(object obj)
    Parameters
    Type Name Description
    object obj

    The object.

    Returns
    Type Description
    byte[]

    A JSON encoded string.

    SerializeToString(object)

    Serializes an object to a JSON encoded string.

    Declaration
    public static string SerializeToString(object obj)
    Parameters
    Type Name Description
    object obj

    The object.

    Returns
    Type Description
    string

    A JSON encoded string.

    In this article
    Back to top Generated by DocFX