简体   繁体   中英

Fastest way to move a chunk of bytes from one position in a byte array to another within the same array

So the question is pretty straight forward. I have a byte array and I want to move a chunk of those bytes from index i to index i - delta .

Currently I'm using Array.Copy but I'm worried that it might have trouble if the source and destination is the same. Also, Array.Copy deals with any array and since I have this specific type I was wondering if there exists a faster solution.

If sourceArray and destinationArray overlap, this method behaves as if the original values of sourceArray were preserved in a temporary location before destinationArray is overwritten.

http://msdn.microsoft.com/en-us/library/z50k9bft.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM