c# - Selecting part of an array to write into -
this question has answer here:
- how copy part of array array in c#? 4 answers
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
Post a Comment