title: How do I decode repeating unsigned MSB and LSB 8-bit words?
body: <p>I'm writing a module that accepts some data from a spectrometer via a serial port and needs to decode it. The spectral data is encoded as 512-bytes in repeating unsigned MSB and LSB 8-bit words according to the manual. How would I decode this in C/C++?</p>
  
  <blockquote>
    <p>23 – 534 encoded as 512-bytes in repeating unsigned MSB and LSB 8-bit words
    [MSB]*256 + [LSB].</p>
  </blockquote>
  
  <p>That's a snippet from the manual.</p>
  
  <p>Okay, I'd like to add in <strong>another portion</strong> to this question. According to a comment below, this is in big-endian. Now, what I'm confused about it is that if it indeed is in big-endian, wouldn't conversion to little-endian be as simple as reversing the order of all the bytes? And if that is the case, then the output to that would essentially be something like... LSB5, MSB5, LSB4, MSB4, LSB3, MSB3, LSB2, MSB2, LSB1, MSB1 and so on, which could then be converted to 16-bit words. What is it that I'm going wrong with here?</p>
  
  <p>Also, if this is indeed big-endian, aren't there any native (even platform-specific if necessary, but faster) methods to handle the conversion?</p>