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); }
public void CopyTo(T[] destination, int destinationIndex, int sourceIndex, int length) { _piece.CopyTo(destination, destinationIndex, _index + sourceIndex, length); }