Table of Contents

Method DangerousGetReference

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

DangerousGetReference()

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

public ref T DangerousGetReference()

Returns

T

A reference to the first element within the current instance.

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.

Exceptions

ObjectDisposedException

Thrown when the buffer in use has already been disposed.