Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    BinarySerialization Class

    Namespace: Stride.Core.Serialization
    Assembly: Stride.Core.dll

    Binary serialization method helpers to easily read/write data from a stream.

    System.Object → BinarySerialization
    Derived from BinarySerialization:

    public class BinarySerialization
    Remarks

    This class is a simple front end to BinarySerializationReader and BinarySerializationWriter.

    Name Description
    Methods
    Read<T>(Byte[])

    Reads an object instance from the specified byte buffer.

    Read<T>(Stream)

    Reads an object instance from the specified stream.

    Write<T>(Stream, T)

    Writes an object instance to the specified stream.

    | Improve this Doc View Source

    Methods


    Read<T>(Byte[])

    Reads an object instance from the specified byte buffer.

    public static T Read<T>(byte[] buffer)
    Parameters
    Type Name Description
    System.Byte[] buffer

    The byte buffer to read the object instance.

    Returns
    Type Description
    T

    An object instance of type T.

    Type Parameters
    Name Description
    T

    Type of the object to read


    Read<T>(Stream)

    Reads an object instance from the specified stream.

    public static T Read<T>(Stream stream)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The stream to read the object instance.

    Returns
    Type Description
    T

    An object instance of type T.

    Type Parameters
    Name Description
    T

    Type of the object to read


    Write<T>(Stream, T)

    Writes an object instance to the specified stream.

    public static void Write<T>(Stream stream, T value)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The stream to write the object instance to.

    T value

    The value to write.

    Type Parameters
    Name Description
    T

    Type of the object to write


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation