title: Does BitArray endianess always match BitConverter endianess?
body: <p>If my class uses the BitArray and BitConverter classes, will the endianess of both always match?</p>
  
  <p>The documentation for the BitConverter constructor explicitly mentions that it depends on the architecture it is being used on (so nearly always little-endian), however the <a href="https://msdn.microsoft.com/en-us/library/x1xda43a(v=vs.110).aspx" rel="nofollow">BitArray(Byte) constructor</a> documentation just says:</p>
  
  <blockquote>
    <p>The first byte in the array represents bits 0 through 7, the second byte represents bits 8 through 15, and so on</p>
  </blockquote>
  
  <p>But this does not specify if the endianess scheme holds for using <a href="https://msdn.microsoft.com/en-us/library/system.collections.bitarray.copyto(v=vs.110).aspx" rel="nofollow">BitArray.CopyTo()</a>, for example.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>An example where this might matter is:</p>
  
  <pre><code>Dim MyBitArray As BitArray = New BitArray(16, false)
  '...here some values might have been assigned to the bit array...
  Dim ba As Byte() = New Byte() {0, 0}
  MyBitArray.CopyTo(ba, 0) 'Copy bit array to byte array
  Dim x As Int16 = BitConverter.ToInt16(ba, 0)'Converter expects little endian, but did CopyTo put the bytes into the array in the right order?
  </code></pre>