ReadOnlySpan<T>
ReadOnlySpan represents a contiguous region of arbitrary memory. Unlike arrays, it can point to either managed
or native memory, or to memory allocated on the stack. It is type- and memory-safe.
Enumerates the elements of a ReadOnlySpan<T>.
Returns a 0-length read-only span whose base is the null pointer.
Returns true if Length is 0.
Returns the specified element of the read-only span.
The number of items in the read-only span.
Creates a new read-only span over the entirety of the target array.
Creates a new read-only span over the portion of the target array beginning
at 'start' index and ending at 'end' index (exclusive).
Creates a new read-only span over the target unmanaged buffer. Clearly this
is quite dangerous, because we are creating arbitrarily typed T's
out of a void*-typed block of memory. And the length is not checked.
But if this creation is correct, then all subsequent uses are correct.
Returns true if left and right point at the same memory and have the same length. Note that
this does *not* check to see if the *contents* are equal.
Defines an implicit conversion of an array to a ReadOnlySpan<T>
Defines an implicit conversion of a ArraySegment<T> to a ReadOnlySpan<T>
Returns false if left and right point at the same memory and have the same length. Note that
this does *not* check to see if the *contents* are equal.
Copies the contents of this read-only span into destination span. If the source
and destinations overlap, this method behaves as if the original values in
a temporary location before the destination is overwritten.
The span to copy items into.Thrown when the destination Span is shorter than the source Span.
Gets an enumerator for this span.
Returns a reference to the 0th element of the Span. If the Span is empty, returns null reference.
It can be used for pinning and is required to support the use of span within a fixed statement.
Forms a slice out of the given read-only span, beginning at 'start'.
Forms a slice out of the given read-only span, beginning at 'start', of given length
Copies the contents of this read-only span into a new array. This heap
allocates, so should generally be avoided, however it is sometimes
necessary to bridge the gap with APIs written in terms of arrays.
Copies the contents of this read-only span into destination span. If the source
and destinations overlap, this method behaves as if the original values in
a temporary location before the destination is overwritten.
If the destination span is shorter than the source span, this method
return false and no data is written to the destination.