I think you’re looking to iterate over the byte array and find the absolute value of each element. Math.abs() should work for that. https://www.geeksforgeeks.org/java-math-abs-method-examples/
solved Setting all values in a byte array positiv [closed]