title: Compare two Byte Arrays? (Java)
body: <p>I have a byte array with a ~known binary sequence in it. I need to confirm that the binary sequence is what it's supposed to be. I have tried <code>.equals</code> in addition to <code>==</code>, but neither worked. </p>
  
  <pre><code>byte[] array = new BigInteger("1111000011110001", 2).toByteArray();
  if (new BigInteger("1111000011110001", 2).toByteArray() == array){
      System.out.println("the same");
  } else {
      System.out.println("different'");
  }
  </code></pre>