Compare byte[i] with string In java
<p>I have string like this</p>

<pre><code>String text = "f001050000000000003d61c1c1df400200c0000009181600ef014000003f20"
</code></pre>

<p>I converted it to bytes to loop through it as bytes</p>

<pre><code>byte[] bytes = new BigInteger(text,16).toByteArray();        
    for (int i = 1; i &lt; bytes.length; i++) 
    {            
        System.out.print(String.format("%02x ", bytes[i]));
    }
</code></pre>

<p>I want to compare byte value of i <code>bytes[i]</code> with equivalent string 
something like that</p>

<pre><code>for (int i = 1; i &lt; bytes.length; i++) 
    {      
        if (bytes[i] == "f0")
        {
            break;
        }
        System.out.print(String.format("%02x ", bytes[i]));
    }
</code></pre>

<p>This will not work for sure, but how can I do this compare</p>
