MemoryOwner<T>.DangerousGetReference Method

Definition

Returns a reference to the first element within the current instance, with no bounds check.

public ref T DangerousGetReference ();
member this.DangerousGetReference : unit -> 'T
Public Function DangerousGetReference () As T

Returns

T

A reference to the first element within the current instance.

Exceptions

Thrown when the buffer in use has already been disposed.

Remarks

This method does not perform bounds checks on the underlying buffer, but does check whether the buffer itself has been disposed or not. This check should not be removed, and it's also the reason why the method to get a reference at a specified offset is not present.

Applies to