I am trying to do a bitwise operation on a byte array with streams but it gives me the error that says "Inconvertible types; cannot cast 'byte[]' to 'int'". I want to bitwise every item in the byte array with 0xff via streams.
byte[] packet;
//this does not work
Stream.of(packet).parallel().map(e->(int)e&0xff)//then put int into an array or list
//basically this is what I am trying to do with streams
int[] castedValues = new int[packet.length];
for (int i = 0; i < packet.length; i++) {
castedValues[i] = packet[i];
}