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