My Problem is BitArray (System.Collentions.BitArray)
if you run the code below
byte [] bits = new byte[2];
bits[0] = 1;
bits[1] = 3;
BitArray BA = new BitArray(bits);
string st = string.Empty;
for(int i=0; i< 16; i++)
st += Convert.ToInt16(BA.Get(i)).ToString();
MessageBox.Show(st);
the code will create byte array with to bytes
first byte will be: "00000001"(binary view of 1) and the second: "00000011" (binary view of 3)
and the we add this two byte to a bitarray the result of bitArray will be "1000000011000000" as you can see BitArray Class invese the bytes "10000000" ( IS NOT BINARY VIEW OF 1) and "11000000" (is not binary view of 3)
as you can see if you inverse all the BA (BitArray) it will be "0000001100000001" And it's not our number either
i don't know if it's bug or there other way to creating BitArray class. i have runed the code in both VS.NET 2003 And VS.NET 2005 even in VB both the result is the sam
.NET Development14
|