Equivalent of strcmp() in Java for comparing byte arrays
<p>I use a byte array to fit 1024 bytes. The problem is, at separate times in my code I need to only use SOME of those bits. In C, I have used...</p>

<pre><code>byte buff[] = read();
strcmp( buff, "CMD\r\n" );
</code></pre>

<p>This would ignore all later bytes in the array, and only compare the first 5 bytes. Is there an easy way to do this in Java?</p>
