public static RequiresInInclusiveRange ( int start, int end, int length ) : void | ||
start | int | |
end | int | |
length | int | |
return | void |
public static void RequiresInInclusiveRange(int start, int end, int length)
{
if (!(start >= 0 && start <= end && end >= 0 && end <= length)) {
throw new ArgumentOutOfRangeException();
}
}
}
Contract::RequiresInInclusiveRange ( int start, int length ) : void |
public static void Write <[Primitive] T>(this Span <byte> slice, T value) where T : struct { Contract.RequiresInInclusiveRange(Unsafe.SizeOf <T>(), (uint)slice.Length); Span <T> castedSlice = slice.Cast <byte, T>(); castedSlice[0] = value; }