mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-30 03:30:30 +02:00
Strip trailing space in hexdump
This commit is contained in:
@@ -371,12 +371,16 @@ public abstract class BluetoothCommunication {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.length == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
final StringBuilder stringBuilder = new StringBuilder(3 * data.length);
|
final StringBuilder stringBuilder = new StringBuilder(3 * data.length);
|
||||||
for (byte byteChar : data) {
|
for (byte byteChar : data) {
|
||||||
stringBuilder.append(String.format("%02X ", byteChar));
|
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) {
|
protected byte xorChecksum(byte[] data, int offset, int length) {
|
||||||
|
Reference in New Issue
Block a user