public static void CopyTo <T>(this T[] arr, ref T[] tar) where T : PacketObject <T> { if (tar == null) { tar = new T[arr.Length]; } else { PacketObject.BackArray(tar); Array.Resize(ref tar, arr.Length); } for (var i = 0; i < arr.Length; ++i) { tar[i] = arr[i].Clone(); } }