Buffer.BlockCopy VS Array.Copy VS ConstrainedCopy

Buffer.BlockCopy更高效,可是僅限於primitive類型 spa

Array.ConstrainedCopy validates arrays before it copies them. The regular Array.Copy method will silently copy a byte array to an int array. The Array.ConstrainedCopy method instead throws an exception. This can improve reliability. ci

Copies a range of elements from an Array starting at the specified source index and pastes them to another Array starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely. element

相關文章
相關標籤/搜索