<PackageReference Include="System.Buffers" Version="4.4.0-preview2-25405-01" />

ArrayPool<T>

public abstract class ArrayPool<T>
Provides a resource pool that enables reusing instances of type T[].
public static ArrayPool<T> Shared { get; }

Retrieves a shared ArrayPool<T> instance.

protected ArrayPool()

public static ArrayPool<T> Create()

Creates a new ArrayPool<T> instance using default configuration options.

public static ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket)

Creates a new ArrayPool<T> instance using custom configuration options.

public abstract T[] Rent(int minimumLength)

Retrieves a buffer that is at least the requested length.

public abstract void Return(T[] array, bool clearArray = false)

Returns to the pool an array that was previously obtained via Rent on the same ArrayPool<T> instance.