Fixed #fixed incorrect use toString method.
Fixed #fixed incorrect use toString method.
Motivation
I found an incorrect use toString method. I think it's maybe a bug.
@@ -209,7 +209,7 @@ public class CmdConsume {
return new String(msgData);
} else {
HexDump.dump(msgData, 0, out, 0);
- return new String(out.toByteArray());
+ return out.toString();
}
}
@@ -424,7 +424,8 @@ public class CmdConsume {
LOG.debug("No message to consume after waiting for 5 seconds.");
} else {
try {
- System.out.println(Base64.getDecoder().decode(msg));
+ String output = interpretByteArray(displayHex, Base64.getDecoder().decode(msg));
+ System.out.println(output); // print decode
} catch (Exception e) {
System.out.println(msg);
}
