title: Comparing ByteArray in Kotlin
body: <p>I have two byte arrays and I would like to compare them. I have a loop like this (for clarity, its more of a <em>Javaish</em> loop):</p>
  
  <pre><code>for (i in 0..63) {
      if (newArray[i] != oldArray[i]) {
          return newArray[i] &lt; oldArray[i]
      }
  }
  </code></pre>
  
  <p>For example, <code>newArray[0]</code> is <code>0x93</code> and <code>oldArray[0]</code> is <code>0x00</code>. This still returns <em>true</em> (meaning newArray is smaller than oldArray) because it is done as a signed comparison. Is there a way to compare absolute (unsigned) values? Or a collection to compare byte arrays?</p>