InputStream.read() must return values in range [0, 255]. But the previous code would sign extend when casting to int so return [-128, 127]. Bitwise AND with 0xff to remove sign extension.
InputStream.read() must return values in range [0, 255]. But the previous code would sign extend when casting to int so return [-128, 127]. Bitwise AND with 0xff to remove sign extension.