c# - Join specific bits -
i have dto object data
2 property: int value
, int width
. have list<data> datalist
. have byte[] result
.
i need process list that:
foeach(var data in datalist) { var bytedata = bitconverter.getbytes(data.value); //result 4 bytes length //than need copy bits starting hight (left) bytedata result, equal data.width. //so if datalist have 2 elements: datalist[0] value = 11101000 00000000 00000000 00000000 , width = 5 // , datalist[1] value = 11000111 11011000 00000000 00000000 , width = 9 //result should 11101110 00111100 }
Comments
Post a Comment