From be01341a0647b30c45e61db7ba8c4e46ba6718fd Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 17 May 2007 13:29:33 +0000 Subject: [PATCH] =?utf8?q?-=20Entfernt=20Leerzeichen=20am=20Anfang=20und?= =?utf8?q?=20Ende=20von=20CommandStrings=20-=20F=C3=BCgt=200x=20bei=20der?= =?utf8?q?=20Ausgabe=20an=20Hexzahlen=20vor?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://www.internetallee.de/svn/bytewurf@31 a944a559-bf0e-0410-8ddc-85264b264b6c --- .../netzschalter/src/de/bytewurf/projekte/netzschalter/Command.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projekte/netzschalter/src/de/bytewurf/projekte/netzschalter/Command.java b/projekte/netzschalter/src/de/bytewurf/projekte/netzschalter/Command.java index adcd547..60548c8 100644 --- a/projekte/netzschalter/src/de/bytewurf/projekte/netzschalter/Command.java +++ b/projekte/netzschalter/src/de/bytewurf/projekte/netzschalter/Command.java @@ -13,7 +13,7 @@ public class Command { byte[] commandBytes; Command(String commandString) { - String[] commands = commandString.split("[\t\n ,]+", 100); + String[] commands = commandString.trim().split("[\t\n ,]+", 100); commandBytes = new byte[commands.length]; try { for (int i = 0; i < commands.length; i++) { @@ -28,7 +28,7 @@ public class Command { public String toString() { StringBuffer result = new StringBuffer(); for (int i = 0; i < commandBytes.length; i++) { - result.append(Integer.toHexString(commandBytes[i] & 0xFF)); + result.append("0x" + Integer.toHexString(commandBytes[i] & 0xFF)); if (i < commandBytes.length - 1); result.append(", "); } -- 2.11.0