From: Matthias T. <mt...@us...> - 2005-09-12 19:32:00
|
Update of /cvsroot/arianne/marauroa/src/marauroa/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23550/common Modified Files: Utility.java Log Message: Fixed bug with slot updates when removing an object. Note that it is not possible to change an attribute of an object currently in a slot. That may be fixed later. Index: Utility.java =================================================================== RCS file: /cvsroot/arianne/marauroa/src/marauroa/common/Utility.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Utility.java 11 Sep 2005 11:09:21 -0000 1.1 --- Utility.java 12 Sep 2005 19:31:22 -0000 1.2 *************** *** 38,47 **** public static String dumpByteArray(byte[] byteArray) { try { - InputStream byteStream = new ByteArrayInputStream(byteArray); - int index = 0; - StringBuilder result = new StringBuilder(); StringBuilder chars = new StringBuilder(); --- 38,51 ---- public static String dumpByteArray(byte[] byteArray) { + return dumpInputStream(new ByteArrayInputStream(byteArray)); + } + + /** creates a nice hex-dump of the byte array */ + public static String dumpInputStream(InputStream byteStream) + { + StringBuilder result = new StringBuilder(); try { int index = 0; StringBuilder chars = new StringBuilder(); *************** *** 80,84 **** catch (Exception e) { ! return "Exception: "+e.getMessage(); } } --- 84,88 ---- catch (Exception e) { ! return result.toString()+"\nException: "+e.getMessage(); } } |