Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
System Namespace
Array Class
Array Methods
Copy Method

  Switch on low bandwidth view
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Array..::.Copy Method

Copies a range of elements in one Array to another Array and performs type casting and boxing as required.

  NameDescription
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCopy(Array, Array, Int32)Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 32-bit integer.
Public methodStatic memberCopy(Array, Array, Int64)Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 64-bit integer.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCopy(Array, Int32, Array, Int32, Int32)Copies a range of elements from an Array starting at the specified source index and pastes them to another Array starting at the specified destination index. The length and the indexes are specified as 32-bit integers.
Public methodStatic memberCopy(Array, Int64, Array, Int64, Int64)Copies a range of elements from an Array starting at the specified source index and pastes them to another Array starting at the specified destination index. The length and the indexes are specified as 64-bit integers.
Top
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Dirty trick to cast the array without copying      Kristof Verbiest   |   Edit   |   Show History
If you just want to cast the array (from one value type to another) and the array is very large, the overhead of copying all data using Array.Copy might be significant. There is a dirty trick to cast the array without copying. This trick is explained here: http://kristofverbiest.blogspot.com/2008/11/casting-array-of-value-types.html
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker