DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="2.5.0" />

 ArrayRental<T>

Represents array obtained from array pool.
public bool IsEmpty { get; }

Gets value indicating that this object is empty.

public ref T this[long index] { get; }

Gets the array element by its index.

public int Length { get; }

Gets length of the rented array.

public Memory<T> Memory { get; }

Gets the memory associated with the rented array.

public MemoryOwner<T> Owner { get; }

Converts this instance to MemoryOwner<T>.

public ArraySegment<T> Segment { get; }

Gets the rented array.

public Span<T> Span { get; }

Gets the span of array elements.

public ArrayRental(ArrayPool<T> pool, int minimumLength, bool clearArray)

Obtains a new array from array pool.

public ArrayRental(ArrayPool<T> pool, int minimumLength)

Obtains a new array from array pool.

public ArrayRental(int minimumLength, bool clearArray)

Obtains a new array from Shared.

public ArrayRental(int minimumLength)

Obtains a new array from Shared.

public ArrayRental(T[] array, int length)

Rents the array.

public ArrayRental(T[] array)

Rents the array.

public static MemoryOwner<T> op_Implicit(ref ArrayRental array)

Converts rented array to the memory owner.

public void Clear()

Sets all elements of the rented array to default value of type T.

public void Dispose()

Returns the array back to the pool.

public ref T GetPinnableReference()

Obtains managed pointer to the first element of the rented array.