My class has a property public byte[] Location{get;} = new byte[30];
I want to be able to fill it from a ReadOnlySpan<byte>
but I cannot find any API methods allowing this.
The closest I've found is:
var array = span.Slice(0,30).ToArray();
Array.Copy(array, Locations, 30);
But having to create a new array just to copy from it seems really ugly... one array creation and 2 copies are involved. I could make the property settable but it's not really the intended design.
Am i missing some obvious method?