Buffer.BlockCopy メソッド
コピー先の配列の指定したオフセット位置を先頭として、コピー元の配列の指定したオフセットから指定数のバイトをコピーします。
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(Arraysrc,intsrcOffset,Arraydst,intdstOffset,intcount);
[C++]
public: static void BlockCopy(Array* src,intsrcOffset,Array* dst,intdstOffset,intcount);
[JScript]
public static function BlockCopy(
src : Array,srcOffset : int,dst : Array,dstOffset : int,count : int);
パラメータ
- src
コピー元のバッファ。 - srcOffset
src のバイト オフセット。 - dst
コピー先のバッファ。 - dstOffset
dst のバイト オフセット。 - count
コピーするバイト数。
例外
例外の種類 | 条件 |
---|---|
ArgumentNullException | src または dst が null 参照 (Visual Basic では Nothing) です。 |
ArgumentException | src や dst はオブジェクトの配列です。値型の配列ではありません。
または src の長さが、 srcOffset に count を加算した値より小さい値です。 または dst の長さが、 dstOffset に count を加算した値より小さい値です。 |
ArgumentOutOfRangeException | srcOffset 、 dstOffset 、または count が 0 未満です。 |
解説
dstOffset を先頭として、 src の srcOffset から count バイトを dst にコピーします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET