Class ReadExtensions | Kinematica | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class ReadExtensions

    Static class that contains various extension methods that allow reading data types from a buffer.

    Inheritance
    Object
    ReadExtensions
    Namespace: Unity.SnapshotDebugger
    Syntax
    public static class ReadExtensions

    Methods

    Read16(Buffer)

    Reads a short (16-bit value) from the buffer.

    Declaration
    public static short Read16(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Int16

    The short that has been read from the buffer.

    Read32(Buffer)

    Reads an integer (32-bit value) from the buffer.

    Declaration
    public static int Read32(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Int32

    The integer that has been read from the buffer.

    ReadBoolean(Buffer)

    Reads a boolean from the buffer.

    Declaration
    public static bool ReadBoolean(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Boolean

    The boolean value that has been read from the buffer.

    ReadBuffer(Buffer, Int32)

    Reads the specified number of bytes into a new buffer.

    Declaration
    public static Buffer ReadBuffer(this Buffer buffer, int bytes)
    Parameters
    Type Name Description
    Buffer buffer
    Int32 bytes
    Returns
    Type Description
    Buffer

    The buffer containing the specified number of bytes that have been read.

    ReadByte(Buffer)

    Reads a single byte (8-bit value) from the buffer.

    Declaration
    public static byte ReadByte(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Byte

    The byte that has been read from the buffer.

    ReadBytes(Buffer, Byte[], Int32, Int32)

    Reads a series of bytes from the buffer.

    Declaration
    public static void ReadBytes(this Buffer buffer, byte[] rhs, int offset, int amount)
    Parameters
    Type Name Description
    Buffer buffer
    Byte[] rhs

    Destination array that the bytes should be written to.

    Int32 offset

    Offset into the destination array where the bytes should be written to.

    Int32 amount

    Number of bytes to be read from the buffer.

    ReadBytes(Buffer, Int32)

    Reads a series of bytes from the buffer.

    Declaration
    public static byte[] ReadBytes(this Buffer buffer, int amount)
    Parameters
    Type Name Description
    Buffer buffer
    Int32 amount

    Number of bytes to be read from the buffer.

    Returns
    Type Description
    Byte[]

    The array of bytes that has been read from the buffer.

    ReadColor(Buffer)

    Reads a color from the buffer.

    Declaration
    public static Color ReadColor(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Color

    The color that has been read from the buffer.

    Remarks

    The individual color components are expected to be stored as floating point values.

    ReadColor32(Buffer)

    Reads a color from the buffer.

    Declaration
    public static Color32 ReadColor32(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Color32

    The color that has been read from the buffer.

    Remarks

    The individual color components are expected to be stored as byte (8-bit) values.

    ReadComponent<T>(Buffer)

    Reads a component reference from the buffer.

    Declaration
    public static T ReadComponent<T>(this Buffer buffer)
        where T : Component
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    T

    The component reference that has been read from the buffer.

    Type Parameters
    Name Description
    T
    Remarks

    Component references are stored as an index relative to a GameObject. If components are added to or removed from the GameObject, this method will have undefined results.

    ReadFromStream<T>(NativeArray<T>, Buffer)

    Reads a native array from the buffer.

    Declaration
    public static void ReadFromStream<T>(this NativeArray<T> nativeArray, Buffer buffer)
        where T : struct
    Parameters
    Type Name Description
    NativeArray<T> nativeArray
    Buffer buffer
    Type Parameters
    Name Description
    T

    ReadFromStream<T>(NativeList<T>, Buffer)

    Reads a native list from the buffer.

    Declaration
    public static void ReadFromStream<T>(this NativeList<T> nativeList, Buffer buffer)
        where T : struct
    Parameters
    Type Name Description
    NativeList<T> nativeList
    Buffer buffer
    Type Parameters
    Name Description
    T

    ReadQuaternion(Buffer)

    Reads a quaternion from the buffer.

    Declaration
    public static Quaternion ReadQuaternion(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Quaternion

    The quaternion that has been read from the buffer.

    ReadQuaternionQuantized(Buffer)

    Reads a quantized quaternion from the buffer.

    Declaration
    public static Quaternion ReadQuaternionQuantized(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Quaternion

    The original quaternion value.

    ReadSingle(Buffer)

    Reads a 32-bit floating point value from the buffer.

    Declaration
    public static float ReadSingle(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Single

    The floating point value that has been read from the buffer.

    ReadSingleQuantized(Buffer)

    Reads a quantized floating point value from the buffer.

    Declaration
    public static float ReadSingleQuantized(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Single

    The original floating point value.

    ReadString(Buffer)

    Reads a string from the buffer.

    Declaration
    public static string ReadString(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    String

    The string that has been read from the buffer.

    ReadTransform(Buffer)

    Reads a transform reference from the buffer.

    Declaration
    public static Transform ReadTransform(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Transform

    A reference to the transform that has been read from the buffer.

    Remarks

    Transform references are stored as absolute paths to the transform. If the serialized Transform has been reparented or renamed, this method will have undefined results.

    ReadVector2(Buffer)

    Reads a vector2 from the buffer.

    Declaration
    public static Vector2 ReadVector2(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Vector2

    The vector that has been read from the buffer.

    ReadVector2Quantized(Buffer)

    Reads a quantized vector2 from the buffer.

    Declaration
    public static Vector2 ReadVector2Quantized(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Vector2

    The original vector2 value.

    ReadVector3(Buffer)

    Reads a vector3 from the buffer.

    Declaration
    public static Vector3 ReadVector3(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Vector3

    The vector that has been read from the buffer.

    ReadVector3Quantized(Buffer)

    Reads a quantized vector3 from the buffer.

    Declaration
    public static Vector3 ReadVector3Quantized(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Vector3

    The original vector3 value.

    ReadVector4(Buffer)

    Reads a vector4 from the buffer.

    Declaration
    public static Vector4 ReadVector4(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Vector4

    The vector that has been read from the buffer.

    ReadVector4Quantized(Buffer)

    Reads a quantized vector4 from the buffer.

    Declaration
    public static Vector4 ReadVector4Quantized(this Buffer buffer)
    Parameters
    Type Name Description
    Buffer buffer
    Returns
    Type Description
    Vector4

    The original vector4 value.

    See Also

    Buffer
    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