title: C# byte[] to List<bool>
body: <p>From bool[] to byte[]: <a href="https://stackoverflow.com/questions/713057/convert-bool-to-byte-c">Convert bool[] to byte[]</a></p>
  
  <p>But I need to convert a byte[] to a List where the first item in the list is the LSB.</p>
  
  <p>I tried the code below but when converting to bytes and back to bools again I have two totally different results...:</p>
  
  <pre><code>public List&lt;bool&gt; Bits = new List&lt;bool&gt;();
  
  
      public ToBools(byte[] values)
      {
          foreach (byte aByte in values)
          {
              for (int i = 0; i &lt; 7; i++)
              {
                  Bits.Add(aByte.GetBit(i));
              }
          }
      }
  
  
  
      public static bool GetBit(this byte b, int index)
      {
          if (b == 0)
              return false;
  
          BitArray ba = b.Byte2BitArray();
          return ba[index];
      }
  </code></pre>