Signed/unsigned situation when converting c# to java
<p>I'm currently converting the following piece of code to java from c#:</p>

<pre><code>    public static byte MakeCS(byte[] arr)
    {
        byte cs = 0;
        for (int i = 0; i &lt; arr.Length; i++)
        {
            cs += arr[i];
        }
        return cs;
    }
</code></pre>

<p>My naive conversation is to just change the arr.Length to arr.length ;)</p>

<p>However this gives me incorrect checksums since java has signed bytes and c# has unsigned ones (I tried changing the c# code to sbyte and it worked fine).</p>

<p>What is the correct way to handkle the situation? I know I can "convert" a java byte to unsigned by bitand'ing it with 0xFF, but I'm not sure where to do this!</p>

<p>Thanks!</p>
