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 _
public static void BlockCopy(
 Array src,
 int srcOffset,
 Array dst,
 int dstOffset,
 int count
public: static void BlockCopy(
 Array* src,
 int srcOffset,
 Array* dst,
 int dstOffset,
 int count
public static function BlockCopy(
   src : Array,
 srcOffset : int,
 dst : Array,
 dstOffset : int,
 count : int


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


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.


The length of src is less than srcOffset plus count.


The length of dst is less than dstOffset plus count.

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


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


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

© 2015 Microsoft