0

I have a byte array:

byte[] b = [108, 108, -17, 65] // Arrays.toString(b)

and I want to turn negatives into negatives +256, like: -17 + 256 = 239
so that I have:

b = [108, 108, 239, 65]

I tried:

ByteBuffer buffer = ByteBuffer.wrap(b);

for(int i = 0; i < 4; i++){
   if (b[i] < 0){
      int n = (b[i] + 256);
      byte b1 = (byte) (b[i] + 256);

      buffer.position(i);
      buffer.put(i, (byte) (n & 0xFF));
   }
}

but nothing changes.
I would be very thankful for any advices