static private ThrowArrayTypeMismatchException_ArrayTypeMustBeExactMatch ( |
||
type | ||
return | void |
public Span(T[] array) { if (array == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array); } if (default(T) == null && array.GetType() != typeof(T[])) { ThrowHelper.ThrowArrayTypeMismatchException_ArrayTypeMustBeExactMatch(typeof(T)); } _length = array.Length; _pinnable = Unsafe.As <Pinnable <T> >(array); _byteOffset = SpanHelpers.PerTypeValues <T> .ArrayAdjustment; }
public Memory(T[] array) { if (array == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array); } if (default(T) == null && array.GetType() != typeof(T[])) { ThrowHelper.ThrowArrayTypeMismatchException_ArrayTypeMustBeExactMatch(typeof(T)); } _arrayOrOwnedMemory = array; _index = 0; _length = array.Length; }
public Span(T[] array, int start, int length) { if (array == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array); } if (default(T) == null && array.GetType() != typeof(T[])) { ThrowHelper.ThrowArrayTypeMismatchException_ArrayTypeMustBeExactMatch(typeof(T)); } if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) { ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); } _length = length; _pinnable = Unsafe.As <Pinnable <T> >(array); _byteOffset = SpanHelpers.PerTypeValues <T> .ArrayAdjustment.Add <T>(start); }
public Memory(T[] array, int start, int length) { if (array == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array); } if (default(T) == null && array.GetType() != typeof(T[])) { ThrowHelper.ThrowArrayTypeMismatchException_ArrayTypeMustBeExactMatch(typeof(T)); } if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start)) { ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.start); } _arrayOrOwnedMemory = array; _index = start; _length = length; }