Struct UnsafeStream.Writer
Namespace: Unity.Collections.LowLevel.Unsafe
Syntax
public struct Writer
Properties
ForEachCount
Declaration
public int ForEachCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
Allocate(Int32)
Allocate space for data.
Declaration
public byte *Allocate(int size)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | size | Size in bytes. |
Returns
| Type | Description |
|---|---|
| Byte* |
Allocate<T>()
Allocate space for data.
Declaration
public T Allocate<T>()
where T : struct
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T | The type of value. |
BeginForEachIndex(Int32)
Begin reading data at the iteration index.
Declaration
public void BeginForEachIndex(int foreachIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | foreachIndex |
Remarks
BeginForEachIndex must always be called balanced by a EndForEachIndex.
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.
Write<T>(T)
Write data.
Declaration
public void Write<T>(T value)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| T | value |
Type Parameters
| Name | Description |
|---|---|
| T | The type of value. |