I'm parsing a byte[] to a structure using StructLayout. I've managed to get this to work for integers, arrays, etc but I need to check for bits too. So something like this in C++.

Code:
      struct
      {
         unsigned short  one     : 6;
         unsigned short  two     : 5;
         unsigned short  three   : 5;      
      } field;
I guess I need to use BitArray but I've been unbale to get this to work with StructLayout.

Could anyone point me in the correct direction?
Thank you.