Method AsSpan
AsSpan(nint, int)
Gets a Span<T> that represents a contiguous sequence of values of type T the current pointer is pointing to, starting at the specified start index and having the specified length.
Declaration
public Span<T> AsSpan(nint start, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | start | The start index of the sequence. |
| int | length | The length of the sequence. |
Returns
| Type | Description |
|---|---|
| Span<T> | A Span<T> that represents the specified range of values. |
Remarks
There are no bounds checks performed regarding the start and length parameters.
It is the caller's responsibility to ensure that the specified range is valid and does not exceed the bounds of the sequence the pointer is pointing to.
AsSpan(nuint, int)
Gets a Span<T> that represents a contiguous sequence of values of type T the current pointer is pointing to, starting at the specified start index and having the specified length.
Declaration
public Span<T> AsSpan(nuint start, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| nuint | start | The start index of the sequence. |
| int | length | The length of the sequence. |
Returns
| Type | Description |
|---|---|
| Span<T> | A Span<T> that represents the specified range of values. |
Remarks
There are no bounds checks performed regarding the start and length parameters.
It is the caller's responsibility to ensure that the specified range is valid and does not exceed the bounds of the sequence the pointer is pointing to.
AsSpan(int)
Gets a Span<T> that represents a contiguous sequence of values of type T the current pointer is pointing to, having the specified length.
Declaration
public Span<T> AsSpan(int length)
Parameters
| Type | Name | Description |
|---|---|---|
| int | length | The length of the sequence. |
Returns
| Type | Description |
|---|---|
| Span<T> | A Span<T> that represents the specified range of values. |
Remarks
There are no bounds checks performed regarding the length parameter.
It is the caller's responsibility to ensure that the specified range is valid and does not exceed the bounds of the sequence the pointer is pointing to.