From 54f26f45b9d619d33c147f2a324a04bbcc7955b1 Mon Sep 17 00:00:00 2001 From: shaper Date: Tue, 22 Jan 2002 15:46:56 +0000 Subject: [PATCH] Added toString(byte[]). git-svn-id: https://samskivert.googlecode.com/svn/trunk@538 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/StringUtil.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java index fe833421..e8de6432 100644 --- a/projects/samskivert/src/java/com/samskivert/util/StringUtil.java +++ b/projects/samskivert/src/java/com/samskivert/util/StringUtil.java @@ -1,5 +1,5 @@ // -// $Id: StringUtil.java,v 1.17 2002/01/17 23:00:38 shaper Exp $ +// $Id: StringUtil.java,v 1.18 2002/01/22 15:46:56 shaper Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -138,7 +138,18 @@ public class StringUtil public static void toString (StringBuffer buf, Object val, String openBox, String closeBox) { - if (val instanceof int[]) { + if (val instanceof byte[]) { + buf.append(openBox); + byte[] v = (byte[])val; + for (int i = 0; i < v.length; i++) { + if (i > 0) { + buf.append(", "); + } + buf.append(v[i]); + } + buf.append(closeBox); + + } else if (val instanceof int[]) { buf.append(openBox); int[] v = (int[])val; for (int i = 0; i < v.length; i++) {