1 8 9 package com.sleepycat.je.tree; 10 11 14 public class TreeUtils { 15 16 static private final String SPACES = 17 " " + 18 " " + 19 " " + 20 " "; 21 22 25 public static String indent(int nSpaces) { 26 return SPACES.substring(0, nSpaces); 27 } 28 29 public static String dumpByteArray(byte[] b) { 30 StringBuffer sb = new StringBuffer (); 31 if (b != null) { 32 if (Key.DUMP_BINARY) { 33 for (int i = 0; i < b.length; i++) { 34 sb.append(b[i] & 0xFF); 36 sb.append(" "); 37 } 38 } else { 39 sb.append(new String (b)); 40 } 41 } else { 42 sb.append("null"); 43 } 44 return sb.toString(); 45 } 46 } 47 | Popular Tags |