I am a beginner in Java, I have array of bytes that I need to convert to string.
After that I want to change it back from string to array of bytes.
I tried the code below, but it did not work since the return value from line 2 does not match the original array:
byte[] comData = byteArray;
String value = new String(comData);
byte[] comData2 = value.getBytes();
// comData2 does not equal comData