Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Buffer.BlockCopy Method

Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset.

[Visual Basic]
Public Shared Sub BlockCopy( _
   ByVal src As Array, _
   ByVal srcOffset As Integer, _
   ByVal dst As Array, _
   ByVal dstOffset As Integer, _
   ByVal count As Integer _
)
[C#]
public static void BlockCopy(
 Array src,
 int srcOffset,
 Array dst,
 int dstOffset,
 int count
);
[C++]
public: static void BlockCopy(
 Array* src,
 int srcOffset,
 Array* dst,
 int dstOffset,
 int count
);
[JScript]
public static function BlockCopy(
   src : Array,
 srcOffset : int,
 dst : Array,
 dstOffset : int,
 count : int
);

Parameters

src
The source buffer.
srcOffset
The byte offset into src.
dst
The destination buffer.
dstOffset
The byte offset into dst.
count
The number of bytes to copy.

Exceptions

Exception Type Condition
ArgumentNullException src or dst is a null reference (Nothing in Visual Basic).
ArgumentException src or dst is an object array, not a value type array.

-or-

The length of src is less than srcOffset plus count.

-or-

The length of dst is less than dstOffset plus count.

ArgumentOutOfRangeException srcOffset, dstOffset, or count is less than 0.

Remarks

Copies count bytes from src, beginning at srcOffset, to dst, beginning at dstOffset.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Buffer Class | Buffer Members | System Namespace

Show:
© 2015 Microsoft