I was wondering if there is a way to convert BitArray to bytes (against an array of bytes)? I will have 8 bits in BitArray ..
BitArray b = new BitArray(8);
byte[] bytes = new byte[1];
b.CopyTo(bytes, 0);
This is what I have so far ... It doesn’t matter if I need to change the byte array into bytes, or I can change the BitArray directly into bytes. I would prefer to modify BitArray directly in the byte ... any ideas?
source
share