Class Extensions
Provides some extension methods for various collections.
Namespace: Unity.Collections.LowLevel.Unsafe.NotBurstCompatible
Assembly: Unity.Collections.dll
Syntax
public static class Extensions
Methods
AddNBC(ref UnsafeAppendBuffer, string)
Adds the content of a string to this append buffer.
Declaration
public static void AddNBC(this ref UnsafeAppendBuffer buffer, string value)
Parameters
Type | Name | Description |
---|---|---|
UnsafeAppendBuffer | buffer | The buffer to which to add the string. |
string | value | The string to copy. |
Remarks
The length of the string is written as an int to the buffer before the characters are written.
ReadNextNBC(ref Reader, out string)
Reads a string from this buffer reader.
Declaration
public static void ReadNextNBC(this ref UnsafeAppendBuffer.Reader reader, out string value)
Parameters
Type | Name | Description |
---|---|---|
UnsafeAppendBuffer.Reader | reader | This reader. |
string | value | Outputs the string. |
ToArray<T>(UnsafeHashSet<T>)
Returns a new managed array with all the elements copied from a set.
Declaration
public static T[] ToArray<T>(this UnsafeHashSet<T> set) where T : unmanaged, IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeHashSet<T> | set | The set whose elements are copied to the array. |
Returns
Type | Description |
---|---|
T[] | A new managed array with all the elements copied from a set. |
Type Parameters
Name | Description |
---|---|
T | The type of elements. |
ToBytesNBC(ref UnsafeAppendBuffer)
Returns an unmanaged byte array with a copy of this buffer's contents.
Declaration
public static byte[] ToBytesNBC(this ref UnsafeAppendBuffer buffer)
Parameters
Type | Name | Description |
---|---|---|
UnsafeAppendBuffer | buffer | This buffer. |
Returns
Type | Description |
---|---|
byte[] | An unmanaged byte array with a copy of this buffer's contents. |