From f597036ebb27eb4ba0ab1dc7a3c9a2d318813218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9C=B0=E5=B9=B3=E7=BA=BF?= <22250530@qq.com> Date: Mon, 29 Jun 2015 09:18:36 +0800 Subject: [PATCH] --- src/com/wentch/redkale/util/Utility.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/com/wentch/redkale/util/Utility.java b/src/com/wentch/redkale/util/Utility.java index 82e7883f3..a75d7017e 100644 --- a/src/com/wentch/redkale/util/Utility.java +++ b/src/com/wentch/redkale/util/Utility.java @@ -72,7 +72,19 @@ public final class Utility { byte[] bytes = new byte[buffer.remaining()]; buffer.put(bytes); buffer.flip(); - (System.out).println(Arrays.toString(bytes)); + println(bytes); + } + + public static void println(byte... bytes) { + if (bytes == null) return; + StringBuilder sb = new StringBuilder(); + sb.append('['); + for (byte b : bytes) { + if (sb.length() > 1) sb.append(','); + sb.append(Integer.toHexString(b & 0xff)); + } + sb.append(']'); + (System.out).println(sb); } /**