Method TryResize
TryResize(int, NativeArrayOptions)
Attempts to set the length in bytes. Does nothing if the new length is invalid.
Declaration
public bool TryResize(int newLength, NativeArrayOptions clearOptions = NativeArrayOptions.ClearMemory)
Parameters
Type | Name | Description |
---|---|---|
int | newLength | The desired length. |
NativeArrayOptions | clearOptions | Whether added or removed bytes should be cleared (zeroed). (Increasing the length adds bytes; decreasing the length removes bytes.) |
Returns
Type | Description |
---|---|
bool | True if the new length is valid. |