public static void RequiresInInclusiveRange(uint start, uint length) { if (start > length) { BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException(); } }
public static void RequiresNonNegative(int n) { if (n < 0) { BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException(); } }
internal static unsafe void RequiresOneNotNull <T>(T[] array, void *pointer) { if (array == null && pointer == null) { BufferPrimitivesThrowHelper.ThrowArgumentException(); } }
public static unsafe void RequiresSameReference(void *ptr0, void *ptr1) { if (ptr0 != ptr1) { BufferPrimitivesThrowHelper.ThrowArgumentException(ExceptionArgument.pointer); } }
public static unsafe void RequiresNotNull(ExceptionArgument argument, void *ptr) { if (ptr == null) { BufferPrimitivesThrowHelper.ThrowArgumentNullException(argument); } }
public static void RequiresNotNull <T>(ExceptionArgument argument, T obj) where T : class { if (obj == null) { BufferPrimitivesThrowHelper.ThrowArgumentNullException(argument); } }
public static void Requires(bool condition) { if (!condition) { BufferPrimitivesThrowHelper.ThrowArgumentException(); } }
public static void RequiresInInclusiveRange(int start, int length, uint existingLength) { if ((uint)start > existingLength || length < 0 || (uint)(start + length) > existingLength) { BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException(); } }