.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
Related to #614. The ArrayPoolBufferWriter<T> lacks the DangerousGetArray() API which MemoryOwner<T> and SpanOwner<T> have. We should add it there too to make it easier and clearer how to get the underlying array from a writer.
API breakdown
namespace CommunityToolkit.HighPerformance.Buffers;
public sealed class ArrayPoolBufferWriter<T> : IBuffer<T>, IMemoryOwner<T>
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ArraySegment<T> DangerousGetArray();
}
Overview
Related to #614. The
ArrayPoolBufferWriter<T>
lacks theDangerousGetArray()
API whichMemoryOwner<T>
andSpanOwner<T>
have. We should add it there too to make it easier and clearer how to get the underlying array from a writer.API breakdown
Usage example
Breaking change?
No
Alternatives
Use
MemoryMarshal.TryGetArray
. That's less clear and less discoverable, so not ideal.