c# - Selecting part of an array to write into -


this question has answer here:

i'm building composite of number of byte arrays. i'd looking smart way of doing this:

uint = 1000; uint b = 2000;  key[0:3] = bitconverter.getbytes(a); key[4:7] = bitconverter.getbytes(b); 

i cannot see easy way this. not want use linq. bitconverter.getbytes(a) returns 4 bytes. of course can 16 assignments messy. there looking syntax fast?

use array.copy method each of getbytes() result.

http://msdn.microsoft.com/en-us/library/system.array.copy(v=vs.110).aspx


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -