docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class IncomingMessage

    Utility class for reading the data sent to the SideChannel.

    Inheritance
    object
    IncomingMessage
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MLAgents.SideChannels
    Assembly: Unity.ML-Agents.dll
    Syntax
    public class IncomingMessage : IDisposable

    Constructors

    IncomingMessage(byte[])

    Construct an IncomingMessage from the byte array.

    Declaration
    public IncomingMessage(byte[] data)
    Parameters
    Type Name Description
    byte[] data

    Byte array

    Methods

    Dispose()

    Clean up the internal storage.

    Declaration
    public void Dispose()

    GetRawBytes()

    Gets the original data of the message. Note that this will return all of the data, even if part of it has already been read.

    Declaration
    public byte[] GetRawBytes()
    Returns
    Type Description
    byte[]

    Original data of the message.

    ReadBoolean(bool)

    Read a boolean value from the message.

    Declaration
    public bool ReadBoolean(bool defaultValue = false)
    Parameters
    Type Name Description
    bool defaultValue

    Default value to use if the end of the message is reached.

    Returns
    Type Description
    bool

    True if boolean was read by the reader, False if not.

    ReadFloat32(float)

    Read a float value from the message.

    Declaration
    public float ReadFloat32(float defaultValue = 0)
    Parameters
    Type Name Description
    float defaultValue

    Default value to use if the end of the message is reached.

    Returns
    Type Description
    float

    True if float32 was read by the reader, False if not.

    ReadFloatList(IList<float>)

    Reads a list of floats from the message. The length of the list is stored in the message.

    Declaration
    public IList<float> ReadFloatList(IList<float> defaultValue = null)
    Parameters
    Type Name Description
    IList<float> defaultValue

    Default value to use if the end of the message is reached.

    Returns
    Type Description
    IList<float>

    True if list of float was read by the reader, False if not.

    ReadInt32(int)

    Read an integer value from the message.

    Declaration
    public int ReadInt32(int defaultValue = 0)
    Parameters
    Type Name Description
    int defaultValue

    Default value to use if the end of the message is reached.

    Returns
    Type Description
    int

    True if int32 was read by the reader, False if not.

    ReadString(string)

    Read a string value from the message.

    Declaration
    public string ReadString(string defaultValue = null)
    Parameters
    Type Name Description
    string defaultValue

    Default value to use if the end of the message is reached.

    Returns
    Type Description
    string

    True if string was read by the reader, False if not.

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)