I have bool array:
bool[] b6=new bool[] {true, true, true, true, true, false, true, true,
true, false, true, false, true, true, false, false };
How can I convert this into an array of bytes such that
- byte[0]=0xFB
- byte[1]=AC
- etc
I believe you want something like this:
EDIT: Original bit of answer before the requirements were clarified:
You haven’t said what you want the conversion to do. For example, this would work:
Or similarly (but slightly less efficiently) using LINQ: