How do you convert 3 bytes into a 24 bit number in C#?
<p>I have an array of bytes that I read from a header section of a message. These bytes contain the length of the message. There never are more than 3 bytes and they are ordered from LSB to MSB. So in the example below, 39 is the LSB and 2 is the MSB.</p>

<pre><code>var data = new byte[] { 39, 213, 2 };
</code></pre>

<p>In the example above how can I take those bytes and convert to a number (int,short,etc)?</p>
