1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-29 19:20:36 +02:00

Strip trailing space in hexdump

This commit is contained in:
Erik Johansson
2018-07-05 22:49:16 +02:00
parent 212f6e62f6
commit 1b9f095426

View File

@@ -371,12 +371,16 @@ public abstract class BluetoothCommunication {
return "";
}
if (data.length == 0) {
return "";
}
final StringBuilder stringBuilder = new StringBuilder(3 * data.length);
for (byte byteChar : data) {
stringBuilder.append(String.format("%02X ", byteChar));
}
return stringBuilder.toString();
return stringBuilder.substring(0, stringBuilder.length() - 1);
}
protected byte xorChecksum(byte[] data, int offset, int length) {