Buffer.MemoryCopy 方法
定义
复制内存块。Copies a block of memory.
重载
| MemoryCopy(Void*, Void*, Int64, Int64) |
将指定为长整型值的一些字节从内存中的一个地址复制到另一个地址。Copies a number of bytes specified as a long integer value from one address in memory to another. 此 API 不符合 CLS。This API is not CLS-compliant. |
| MemoryCopy(Void*, Void*, UInt64, UInt64) |
将指定为无符号长整型值的一些字节从内存中的一个地址复制到另一个地址。Copies a number of bytes specified as an unsigned long integer value from one address in memory to another. 此 API 不符合 CLS。This API is not CLS-compliant. |
MemoryCopy(Void*, Void*, Int64, Int64)
重要
此 API 不符合 CLS。
将指定为长整型值的一些字节从内存中的一个地址复制到另一个地址。Copies a number of bytes specified as a long integer value from one address in memory to another.
此 API 不符合 CLS。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);
[System.CLSCompliant(false)]
public static void MemoryCopy (void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy);
public static void MemoryCopy (void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy);
[<System.CLSCompliant(false)>]
[<System.Security.SecurityCritical>]
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * int64 * int64 -> unit
[<System.CLSCompliant(false)>]
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * int64 * int64 -> unit
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * int64 * int64 -> unit
参数
- source
- Void*
要复制的字节的地址。The address of the bytes to copy.
- destination
- Void*
目标地址。The target address.
- destinationSizeInBytes
- Int64
目标内存块中可用的字节数。The number of bytes available in the destination memory block.
- sourceBytesToCopy
- Int64
要复制的字节数。The number of bytes to copy.
- 属性
例外
sourceBytesToCopy 大于 destinationSizeInBytes。sourceBytesToCopy is greater than destinationSizeInBytes.
注解
此方法将 sourceBytesToCopy 字节从指定的地址复制 source 到指定的地址 destination 。This method copies sourceBytesToCopy bytes from the address specified by source to the address specified by destination. 如果源区域的某些区域和目标区域重叠,则函数将确保在覆盖重叠区域中的原始源字节后将其复制。If some regions of the source area and the destination overlap, the function ensures that the original source bytes in the overlapping region are copied before being overwritten.
适用于
MemoryCopy(Void*, Void*, UInt64, UInt64)
重要
此 API 不符合 CLS。
将指定为无符号长整型值的一些字节从内存中的一个地址复制到另一个地址。Copies a number of bytes specified as an unsigned long integer value from one address in memory to another.
此 API 不符合 CLS。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);
[System.CLSCompliant(false)]
public static void MemoryCopy (void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy);
public static void MemoryCopy (void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy);
[<System.CLSCompliant(false)>]
[<System.Security.SecurityCritical>]
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * uint64 * uint64 -> unit
[<System.CLSCompliant(false)>]
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * uint64 * uint64 -> unit
static member MemoryCopy : nativeptr<unit> * nativeptr<unit> * uint64 * uint64 -> unit
参数
- source
- Void*
要复制的字节的地址。The address of the bytes to copy.
- destination
- Void*
目标地址。The target address.
- destinationSizeInBytes
- UInt64
目标内存块中可用的字节数。The number of bytes available in the destination memory block.
- sourceBytesToCopy
- UInt64
要复制的字节数。The number of bytes to copy.
- 属性
例外
sourceBytesToCopy 大于 destinationSizeInBytes。sourceBytesToCopy is greater than destinationSizeInBytes.
注解
此方法将 sourceBytesToCopy 字节从指定的地址复制 source 到指定的地址 destination 。This method copies sourceBytesToCopy bytes from the address specified by source to the address specified by destination. 如果源区域的某些区域和目标区域重叠,则函数将确保在覆盖重叠区域中的原始源字节后将其复制。If some regions of the source area and the destination overlap, the function ensures that the original source bytes in the overlapping region are copied before being overwritten.