According to the documentation though, Buffer.BlockCopy works with primitive types such as byte, char, etc.
But I've found a case where Buffer.BlockCopy doesn't work as it should (or maybe I'm missing something about Buffer.BlockCopy):
Expand|Select|Wrap|Line Numbers
- char[] c1 = { 'a', 'b', 'c', 'd', 'e' };
- char[] c2 = new char[5];
- Buffer.BlockCopy(c1, 0, c2, 0, 5);
If I do an Array.Copy instead of Buffer.BlockCopy, the content of c2 becomes "abcde" as expected.
I'm a bit confused since I always thought that those methods actually will do the same thing as long as primitive types are used.