title: Java Byte Array Equivalant in Java
body: <p>I have a Java Function which use Byte Array, C doesn't have this kind of data Type, How can i write that function in C.</p>
  
  <p>I'm not good in C, Its a Little Confusing for me, I have byte hash1 and byte hash2. </p>
  
  <p>It give me distance in int in java, Why do i need byte in Char in Java. I know the question title looks duplicate but, there is no clear explanation. </p>
  
  <p>Java Code:</p>
  
  <pre><code>public static int distance(byte[] hash1, byte[] hash2) {
      int distance = 0;
      for (int i = 0; i &lt; hash1.length &amp;&amp; i &lt; hash2.length; i++)
      {
          distance += ((hash2[i] &amp; 0xFF) - (hash1[i] &amp; 0xFF))*((hash2[i] &amp; 0xFF) - (hash1[i] &amp; 0xFF));
      }
      return distance;
  }
  </code></pre>