Audio signal plotting code explanation
<p>I'm trying to understand every single line of the following code , but my knowledge prevents me from
being successful.</p>

<p>It's actually a piece of code taken form a java tutorial regarding the plotting of an audio signal (waveform)</p>

<p>In a nutshell what the code does is basically:
if audio data sample size is equal to 16 and encoding type is BigEndian do this...
Well.. the problem is that I'd like to be able to catch the meaning of every single code statement..
Can anyone help me ?
Many thanks in advance...
The original code is here: 
<a href="http://www.koders.com/java/fid3508156A13C80A263E7CE65C4C9D6F5D8651AF5D.aspx?s=%22David+Anderson%22" rel="nofollow">http://www.koders.com/java/fid3508156A13C80A263E7CE65C4C9D6F5D8651AF5D.aspx?s=%22David+Anderson%22</a>
(class SamplingGraph )</p>

<p>The code I'd like to understand is the following:</p>

<pre><code>if (format.getSampleSizeInBits() == 16) {
    int nlengthInSamples = audioBytes.size() / 2;
    audioData = new int[nlengthInSamples];

    if (format.isBigEndian()) {
        for (int i = 0; i &lt; nlengthInSamples; i++) {
        /* First byte is MSB (high order) */
        int MSB = (int) audioBytes.get(2 * i);
        /* Second byte is LSB (low order) */
        int LSB = (int) audioBytes.get(2 * i + 1);
        audioData[i] = MSB &lt;&lt; 8 | (255 &amp; LSB);
        }
</code></pre>

<p>Especially how would you translate in words the following code:</p>

<pre><code>audioData[i] = MSB &lt;&lt; 8 | (255 &amp; LSB);
</code></pre>

<p>...thanks again
Mat</p>
