Linearly copy an array and return the copied array.