Is there a way to retain a signed byte when converting it to a string? Or alternatively make them be seen as unsigned when converting to a string?
Here is my code for example:
byte[] encodedBytes = new byte[RX_Index];
System.arraycopy(RX_Buffer, 0, encodedBytes, 0, encodedBytes.length);
final String data = new String(encodedBytes);
RX_Buffer will contain 0xBF which is -65 signed decimal. After intializing data that 0xBF byte is changed to 0xFFFD after converting to a string for some reason. I'm assuming the problem is the conversion from bytes to string with a negative number. If that can't be the case let me know. Otherwise how do I fix this problem?