For an assignment I get some bytes, make some calculations on their Binary values and have to return that calculated Stuff in a Byte Array.
My Problem is now, that byte only stores up to 127, but my values can be up to 2^8-1 (11111111). I already tried to convert it to hex, but it´s of course not working either.
So, is that possible, if yes how, or is that exercise not possible like that?
If I'm understanding your question, before you perform any calculations you need to AND (&) your bytes against 255, so you'll be dealing with values from 0 to 255 instead of -128 to 127. When you assign a value higher than 127 to a byte it overflows, so 128 as a byte in java is -128, but after you AND (&) -128 against 255 you'll get +128.