Memory<T>.TryCopyTo(Memory<T>) 方法

定义

将此内存的内容复制到目标 Memory<T> 实例。Copies the contents of the memory into a destination Memory<T> instance.

public:
 bool TryCopyTo(Memory<T> destination);
public bool TryCopyTo (Memory<T> destination);
member this.TryCopyTo : Memory<'T> -> bool
Public Function TryCopyTo (destination As Memory(Of T)) As Boolean

参数

destination
Memory<T>

目标 Memory<T> 对象。The destination Memory<T> object.

返回

Boolean

如果复制操作成功,则为 true;否则为 falsetrue if the copy operation succeeds; otherwise, false.

注解

Memory<T> destination 即使当前实例的内容和重叠,此方法也会将当前实例的所有内容复制到中 destinationThis method copies all of the contents of the current Memory<T> instance to destination even if the contents of the current instance and destination overlap.

适用于