Struct UnsafeStream.Reader | Collections | 0.11.0-preview.17
docs.unity3d.com
    Show / Hide Table of Contents

    Struct UnsafeStream.Reader

    Namespace: Unity.Collections.LowLevel.Unsafe
    Syntax
    public struct Reader

    Properties

    ForEachCount

    Returns for each count.

    Declaration
    public int ForEachCount { get; }
    Property Value
    Type Description
    Int32

    RemainingItemCount

    Returns remaining item count.

    Declaration
    public int RemainingItemCount { get; }
    Property Value
    Type Description
    Int32

    Methods

    BeginForEachIndex(Int32)

    Begin reading data at the iteration index.

    Declaration
    public int BeginForEachIndex(int foreachIndex)
    Parameters
    Type Name Description
    Int32 foreachIndex
    Returns
    Type Description
    Int32

    The number of elements at this index.

    Remarks

    BeginForEachIndex must always be called balanced by a EndForEachIndex.

    Count()

    The current number of items in the container.

    Declaration
    public int Count()
    Returns
    Type Description
    Int32

    The item count.

    EndForEachIndex()

    Ensures that all data has been read for the active iteration index.

    Declaration
    public void EndForEachIndex()
    Remarks

    EndForEachIndex must always be called balanced by a BeginForEachIndex.

    Peek<T>()

    Peek into data.

    Declaration
    public T Peek<T>()
        where T : struct
    Returns
    Type Description
    T

    Reference to data.

    Type Parameters
    Name Description
    T

    The type of value.

    Read<T>()

    Read data.

    Declaration
    public T Read<T>()
        where T : struct
    Returns
    Type Description
    T

    Reference to data.

    Type Parameters
    Name Description
    T

    The type of value.

    ReadUnsafePtr(Int32)

    Returns pointer to data.

    Declaration
    public byte *ReadUnsafePtr(int size)
    Parameters
    Type Name Description
    Int32 size

    Size in bytes.

    Returns
    Type Description
    Byte*

    Pointer to data.

    In This Article
    • Properties
      • ForEachCount
      • RemainingItemCount
    • Methods
      • BeginForEachIndex(Int32)
      • Count()
      • EndForEachIndex()
      • Peek<T>()
      • Read<T>()
      • ReadUnsafePtr(Int32)
    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