title: Is there a built-in function to reverse bit order
body: <p>I've come up with several manual ways of doing this, but i keep wondering if there is something built-in .NET that does this.</p>
  
  <p>Basically, i want to reverse the bit order in a byte, so that the least significant bit becomes the most significant bit.</p>
  
  <p>For example:
  1001 1101 = 9D
  would become 
  1011 1001 = B9</p>
  
  <p>On of the ways to do this is to use bitwise operations if following this pseudo code:</p>
  
  <pre><code>for (i = 0; i&lt;8; i++)
  {
    Y&gt;&gt;1
    x= byte &amp; 1
    byte &gt;&gt;1
    y = x|y;
  }
  </code></pre>
  
  <p>I wonder if there is a function somewhere that will allow me to do all this in <strong>one single line</strong>.  Also, do you know the term for such an operation, i'm sure there is one, but i can't remember it at the moment.</p>
  
  <p>Thanks</p>