docs.unity3d.com
    Show / Hide Table of Contents

    Class IncomingMessage

    Utility class for reading the data sent to the SideChannel.

    Inheritance
    Object
    IncomingMessage
    Namespace: Unity.MLAgents.SideChannels
    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

    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[]

    ReadBoolean(Boolean)

    Read a boolean value from the message.

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

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

    Returns
    Type Description
    Boolean

    ReadFloat32(Single)

    Read a float value from the message.

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

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

    Returns
    Type Description
    Single

    ReadFloatList(IList<Single>)

    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<Single> defaultValue

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

    Returns
    Type Description
    IList<Single>

    ReadInt32(Int32)

    Read an integer value from the message.

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

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

    Returns
    Type Description
    Int32

    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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023