Class ArrayPoolExtensions
- Namespace
- LfrlAnvil.Extensions
- Assembly
- LfrlAnvil.Core.dll
Contains ArrayPool<T> extension methods.
public static class ArrayPoolExtensions
- Inheritance
-
ArrayPoolExtensions
- Inherited Members
Methods
RentToken<T>(ArrayPool<T>, int, bool)
Retrieves a token that contains a buffer, that is at least the requested length.
[Pure]
public static ArrayPoolToken<T> RentToken<T>(this ArrayPool<T> pool, int minimumLength, bool clearArray = false)
Parameters
pool
ArrayPool<T>Source resource pool.
minimumLength
intThe minimum length of the array.
clearArray
boolIndicates whether the contents of the buffer should be cleared before reuse, when token gets disposed.
Returns
- ArrayPoolToken<T>
New ArrayPoolToken<T> instance.
Type Parameters
T
The type of the objects that are in the resource pool.