<data name="Arg_ArrayPlusOffTooSmall" xml:space="preserve">
<value>Destination array is not long enough to copy all the items in the collection. Check array index and length.</value>
</data>
+ <data name="Arg_ByteArrayTooSmallForValue" xml:space="preserve">
+ <value>The array starting from the specified index is not long enough to read a value of the specified type.</value>
+ </data>
<data name="Arg_ArrayTypeMismatchException" xml:space="preserve">
<value>Attempted to access an element as a type incompatible with the array.</value>
</data>
if (unchecked((uint)startIndex) >= unchecked((uint)value.Length))
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_IndexMustBeLess);
if (startIndex > value.Length - sizeof(short))
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall, ExceptionArgument.value);
+ ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ByteArrayTooSmallForValue, ExceptionArgument.value);
return Unsafe.ReadUnaligned<short>(ref value[startIndex]);
}
if (unchecked((uint)startIndex) >= unchecked((uint)value.Length))
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_IndexMustBeLess);
if (startIndex > value.Length - sizeof(int))
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall, ExceptionArgument.value);
+ ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ByteArrayTooSmallForValue, ExceptionArgument.value);
return Unsafe.ReadUnaligned<int>(ref value[startIndex]);
}
if (unchecked((uint)startIndex) >= unchecked((uint)value.Length))
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_IndexMustBeLess);
if (startIndex > value.Length - sizeof(long))
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall, ExceptionArgument.value);
+ ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ByteArrayTooSmallForValue, ExceptionArgument.value);
return Unsafe.ReadUnaligned<long>(ref value[startIndex]);
}
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.startIndex, ExceptionResource.ArgumentOutOfRange_IndexMustBeLess);
ArgumentOutOfRangeException.ThrowIfNegative(length);
if (startIndex > value.Length - length)
- ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall, ExceptionArgument.value);
+ ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ByteArrayTooSmallForValue, ExceptionArgument.value);
if (length == 0)
{
return SR.ArgumentOutOfRange_Year;
case ExceptionResource.Arg_ArrayPlusOffTooSmall:
return SR.Arg_ArrayPlusOffTooSmall;
+ case ExceptionResource.Arg_ByteArrayTooSmallForValue:
+ return SR.Arg_ByteArrayTooSmallForValue;
case ExceptionResource.NotSupported_ReadOnlyCollection:
return SR.NotSupported_ReadOnlyCollection;
case ExceptionResource.Arg_RankMultiDimNotSupported:
ArgumentOutOfRange_Count,
ArgumentOutOfRange_Year,
Arg_ArrayPlusOffTooSmall,
+ Arg_ByteArrayTooSmallForValue,
NotSupported_ReadOnlyCollection,
Arg_RankMultiDimNotSupported,
Arg_NonZeroLowerBound,