public static void RequiresNonNegative(int n) { if (n < 0) { BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException(); } }
public static void RequiresInInclusiveRange(uint start, uint length) { if (start > length) { BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException(); } }
public static void RequiresInInclusiveRange(int start, int length, uint existingLength) { if ((uint)start > existingLength || length < 0 || (uint)(start + length) > existingLength) { BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException(); } }