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.
ComputeItemCount()
Compute item count.
Declaration
public int ComputeItemCount()
Returns
Type | Description |
---|---|
Int32 | 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 |
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 |
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 |
Returns
Type | Description |
---|---|
Byte* |