Hi, I'm recieving data in an ByteArray.
Most of the data is easily converted into numeric values, but I'm having problems handling those Bytes that hold information at Bit-Level.
For example Items 3-4 of my ByteArray, which are 16 Bits are holding the information for 16 ON-OFF Type Properties.
I tried something like:
Code:Dim BitInfo(15) As BitArray Buffer.BlockCopy(ByteArray, 3, BitInfo, 0, 2) 'Raising error -2147024809 Object has to be an ArrayIs the BitArray the best way, or should I stay with the Bytes and try to read (and later write) each Bit form there?Code:Dim BitInfo As new BitArray(4) Buffer.BlockCopy(ByteArray, 3, BitInfo, 0, 2) 'Doesn't compile because an BitArray can't be converted into an Array




Reply With Quote