Buffer.MemoryCopy Buffer.MemoryCopy Buffer.MemoryCopy Method

Definition

Copies a block of memory.

Overloads

MemoryCopy(Void*, Void*, Int64, Int64) MemoryCopy(Void*, Void*, Int64, Int64) MemoryCopy(Void*, Void*, Int64, Int64)

Copies a number of bytes specified as a long integer value from one address in memory to another.

This API is not CLS-compliant.

MemoryCopy(Void*, Void*, UInt64, UInt64) MemoryCopy(Void*, Void*, UInt64, UInt64) MemoryCopy(Void*, Void*, UInt64, UInt64)

Copies a number of bytes specified as an unsigned long integer value from one address in memory to another.

This API is not CLS-compliant.

MemoryCopy(Void*, Void*, Int64, Int64) MemoryCopy(Void*, Void*, Int64, Int64) MemoryCopy(Void*, Void*, Int64, Int64)

Important

This API is not CLS-compliant.

Copies a number of bytes specified as a long integer value from one address in memory to another.

This API is not CLS-compliant.

public:
 static void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public static void MemoryCopy (void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy);
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * int64 * int64 -> unit

Parameters

source
Void*

The address of the bytes to copy.

destination
Void*

The target address.

destinationSizeInBytes
Int64 Int64 Int64

The number of bytes available in the destination memory block.

sourceBytesToCopy
Int64 Int64 Int64

The number of bytes to copy.

Exceptions

sourceBytesToCopy is greater than destinationSizeInBytes.

Remarks

This method copies sourceBytesToCopy bytes from the address specified by source to the address specified by destination. If the buffers overlap and the difference between destination minus source is less than sourceBytesToCopy, the source block is copied to the destination block in reverse order.

MemoryCopy(Void*, Void*, UInt64, UInt64) MemoryCopy(Void*, Void*, UInt64, UInt64) MemoryCopy(Void*, Void*, UInt64, UInt64)

Important

This API is not CLS-compliant.

Copies a number of bytes specified as an unsigned long integer value from one address in memory to another.

This API is not CLS-compliant.

public:
 static void MemoryCopy(void* source, void* destination, System::UInt64 destinationSizeInBytes, System::UInt64 sourceBytesToCopy);
[System.CLSCompliant(false)]
[System.Security.SecurityCritical]
public static void MemoryCopy (void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy);
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * uint64 * uint64 -> unit

Parameters

source
Void*

The address of the bytes to copy.

destination
Void*

The target address.

destinationSizeInBytes
UInt64 UInt64 UInt64

The number of bytes available in the destination memory block.

sourceBytesToCopy
UInt64 UInt64 UInt64

The number of bytes to copy.

Exceptions

sourceBytesToCopy is greater than destinationSizeInBytes.

Remarks

This method copies sourceBytesToCopy bytes from the address specified by source to the address specified by destination. If the buffers overlap and the difference between destination minus source is less than sourceBytesToCopy, the source block is copied to the destination block in reverse order.

Applies to