ThrowArgumentException_DestinationTooShort() static private method

static private ThrowArgumentException_DestinationTooShort ( ) : void
return void
Ejemplo n.º 1
0
 /// <summary>
 /// Copies the contents of this read-only span into destination span. If the source
 /// and destinations overlap, this method behaves as if the original values in
 /// a temporary location before the destination is overwritten.
 ///
 /// <param name="destination">The span to copy items into.</param>
 /// <exception cref="System.ArgumentException">
 /// Thrown when the destination Span is shorter than the source Span.
 /// </exception>
 /// </summary>
 public void CopyTo(Span <T> destination)
 {
     if (!TryCopyTo(destination))
     {
         ThrowHelper.ThrowArgumentException_DestinationTooShort();
     }
 }
Ejemplo n.º 2
0
 internal void CopyTo(Span <char> destination)
 {
     if ((uint)Length <= (uint)destination.Length)
     {
         Buffer.Memmove(ref destination._pointer.Value, ref _firstChar, (uint)Length);
     }
     else
     {
         ThrowHelper.ThrowArgumentException_DestinationTooShort();
     }
 }
Ejemplo n.º 3
0
        public void CopyTo(ArraySegment <T> destination)
        {
            ThrowInvalidOperationIfDefault();
            destination.ThrowInvalidOperationIfDefault();

            if (_count > destination._count)
            {
                ThrowHelper.ThrowArgumentException_DestinationTooShort();
            }

            System.Array.Copy(_array, _offset, destination._array, destination._offset, _count);
        }