DotNext by .NET Foundation and Contributors

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

.NET API 536,520 bytes

 PoolingArrayBufferWriter<T>

Represents memory writer that is backed by the array obtained from the pool.
public ref T this[int index] { get; }

Gets the element at the specified index.

public ArraySegment<T> WrittenArray { get; }

Gets the data written to the underlying array so far.

public PoolingArrayBufferWriter(ArrayPool<T> pool = null)

Represents memory writer that is backed by the array obtained from the pool.

public ArraySegment<T> GetArray(int sizeHint = 0)

Returns the memory to write to that is at least the requested size.

public void Insert(int index, ReadOnlySpan<T> items)

Inserts the elements into this buffer at the specified index.

public void Overwrite(int index, ReadOnlySpan<T> items)

Overwrites the elements in this buffer.

public void RemoveFirst(int count)

Removes the specified number of elements from the head of this buffer.

public void RemoveLast(int count)

Removes the specified number of elements from the tail of this buffer.