Read byte from file and use value for if else statement to set boolean var. C#
<p>Very basic question. I read a byte from a file using <code>ByteReader</code>.
That byte is either one of two values (<code>0x42</code> or <code>0x4C</code>).
Now depending on that I want to set a bool value. By now I have this:</p>

<pre><code>byte myByte = br.readByte();
bool myBoolean = true;

if(myByte == 0x4C) myBoolean = true;
else if(myByte == 0x42) myBoolean = false;
else return;
</code></pre>

<p>What I want to avoid is the two variables. I'd like to have just one bool value.
Like this</p>

<pre><code>myBoolean = myByte == 0x4C ? true : false;
</code></pre>

<p>The thing is that this expression only checks for <code>0x4c</code> and not <code>0x42</code></p>

<p>I can only call ReadByte() once because the read position is incremented.
Any ideas?</p>
