Exemple #1
0
        public static T[] ToArray <T>(this IPiece <T> piece, int position, int length)
        {
            if (position + length > piece.Length)
            {
                throw new ArgumentOutOfRangeException();
            }

            var destination = new T[length];

            piece.CopyTo(destination, 0, position, length);
            return(destination);
        }
Exemple #2
0
 public void CopyTo(T[] destination, int destinationIndex, int sourceIndex, int length)
 {
     _piece.CopyTo(destination, destinationIndex, _index + sourceIndex, length);
 }