I have an array of bytes b:
b = [-98, -99]
I need to pass this segment of data to a function. The function takes a String (this is not changeable). How do I get Java to interpret the raw binary data in b as a string without changing any of the bits in b
EDIT
This is not a repeat of:
Converting byte array to String (Java)
Because, the array b consists of the bits [1001 1110 1001 1101] or [9E9D]. If I use
String str = new String(b, "Cp1252")
The Cp1252 encoding does not have a value for the seqeuence of bits 1001 1101 or 9D. So this function results in the the str = "ž?". Which in binary form is [1001 1110 0011 1111] or [9E3F]. Notice the function has changed my bits, which essentially corrupts my data.
I think this would be done in C++ using a reinterpret cast but no such thing exists in java. Thanks in advance.