+
+ static void RangeArgumentsCheck (T[] items, int startIndex, int count)
+ {
+ if (items == null)
+ throw new ArgumentNullException ("items");
+ if (startIndex < 0 || startIndex >= items.Length)
+ throw new ArgumentOutOfRangeException ("startIndex");
+ if (count < 0)
+ throw new ArgumentOutOfRangeException ("count");
+ if (startIndex + count > items.Length)
+ throw new ArgumentException ("startIndex + count is greater than the length of items.");
+ }