title: Bitwise operations in Java using byte and int
body: <p>I'm trying to do some bitwise operations in java</p>
  
  <p>I have 2 arrays:</p>
  
  <pre><code>byte[] bitArray;
  final  byte [] bitMask = {1,2,4,8,16,32,64,-128};
  </code></pre>
  
  <p>then I try to <code>|</code> one byte in the <code>bitArray</code> with one byte in the <code>mask</code>.</p>
  
  <pre><code>bitArray[i] = bitArray[i] | bitMask[j]
  </code></pre>
  
  <p>The Problem is that I'm getting a compiler error.</p>
  
  <p>"error possible loss of precision"
  required byte
  found int</p>
  
  <p>The question is how can I fix it?</p>