Method Resize
Resize(int, ResizeOptions)
Reallocates the underlying buffer if necessary, depending on the given options.
Declaration
public void Resize(int newCount, ResizeOptions options = ResizeOptions.KeepExcessCapacity)
Parameters
Type | Name | Description |
---|---|---|
int | newCount | The new value for Count. Can be 0. |
ResizeOptions | options | The resizing options. The default value is KeepExcessCapacity. |
Remarks
When reallocation occurs, data is not copied over from the previous buffer. After a call to Resize, Count is always equal to the given newCount and Capacity is never smaller than Count. There is no growth factor to the resizing. Resize(0) will keep the current Capacity, while Resize(0, ResizeOptions.TrimExcessCapacity) will deallocate the underlying buffer.