Is there a better way to convert byte array to an int?
<p>The first 3 bytes of a byte array are just integers, is there a better way to convert them? So far I have this but it just feels like a bad way of doing it.</p>

<pre><code>public int parse_code(byte[] bs) {
    char[] array = new char[3];
    for(int i = 0; i &lt; 3; i++) {
        array[i] = (char) bs[i];
    }

    // Dirty way of doing it
    return Integer.parseInt(new String(array));
}
</code></pre>
