Struct NativeStream.Reader
Namespace: Unity.Collections
Syntax
[NativeContainer]
[NativeContainerIsReadOnly]
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. |