Class Extensions
Provides some extension methods for various collections.
Namespace: Unity.Collections.LowLevel.Unsafe.NotBurstCompatible
Syntax
public static class Extensions
Methods
AddNBC(ref UnsafeAppendBuffer, String)
Adds the content of a string to this append buffer.
Declaration
[ExcludeFromBurstCompatTesting("Takes managed string")]
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 UnsafeAppendBuffer.Reader, out String)
Reads a string from this buffer reader.
Declaration
[ExcludeFromBurstCompatTesting("Managed string out argument")]
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>(UnsafeParallelHashSet<T>)
Returns a new managed array with all the elements copied from a set.
Declaration
public static T[] ToArray<T>(this UnsafeParallelHashSet<T> set)
where T : struct, IEquatable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeParallelHashSet<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
[ExcludeFromBurstCompatTesting("Returns managed array")]
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. |