Unsafe.CopyBlock Method

Definition

Overloads

CopyBlock(Byte, Byte, UInt32)

Copies bytes from the source address to the destination address.

CopyBlock(Void*, Void*, UInt32)

Copies bytes from the source address to the destination address.

CopyBlock(Byte, Byte, UInt32)

Source:
Unsafe.cs
Source:
Unsafe.cs
Source:
Unsafe.cs

Important

This API is not CLS-compliant.

Copies bytes from the source address to the destination address.

public:
 static void CopyBlock(System::Byte % destination, System::Byte % source, System::UInt32 byteCount);
public static void CopyBlock (ref byte destination, ref byte source, uint byteCount);
[System.CLSCompliant(false)]
public static void CopyBlock (ref byte destination, ref byte source, uint byteCount);
static member CopyBlock : byte * byte * uint32 -> unit
[<System.CLSCompliant(false)>]
static member CopyBlock : byte * byte * uint32 -> unit
Public Shared Sub CopyBlock (ByRef destination As Byte, ByRef source As Byte, byteCount As UInteger)

Parameters

destination
Byte

The managed pointer corresponding to the destination address to copy to.

source
Byte

The managed pointer corresponding to the source address to copy from.

byteCount
UInt32

The number of bytes to copy.

Attributes

Remarks

This API corresponds to the cpblk opcode. Both the destination and source pointers are assumed to be pointer-aligned. See ECMA-335, Sec. III.3.30 ("cpblk - copy data from memory to memory") for more information.

Caution

This API is not intended for copying arbitrary-length runs of memory. Consider instead using MemoryCopy or CopyTo for this scenario.

Applies to

CopyBlock(Void*, Void*, UInt32)

Source:
Unsafe.cs
Source:
Unsafe.cs
Source:
Unsafe.cs

Important

This API is not CLS-compliant.

Copies bytes from the source address to the destination address.

public:
 static void CopyBlock(void* destination, void* source, System::UInt32 byteCount);
public static void CopyBlock (void* destination, void* source, uint byteCount);
[System.CLSCompliant(false)]
public static void CopyBlock (void* destination, void* source, uint byteCount);
static member CopyBlock : nativeptr<unit> * nativeptr<unit> * uint32 -> unit
[<System.CLSCompliant(false)>]
static member CopyBlock : nativeptr<unit> * nativeptr<unit> * uint32 -> unit

Parameters

destination
Void*

The unmanaged pointer corresponding to the destination address to copy to.

source
Void*

The unmanaged pointer corresponding to the source address to copy from.

byteCount
UInt32

The number of bytes to copy.

Attributes

Remarks

This API corresponds to the cpblk opcode. Both the destination and source pointers are assumed to be pointer-aligned. See ECMA-335, Sec. III.3.30 ("cpblk - copy data from memory to memory") for more information.

Caution

This API is not intended for copying arbitrary-length runs of memory. Consider instead using MemoryCopy or CopyTo for this scenario.

Applies to