return hexDump(buf, 0, buf.length, prefix);
String nl = System.getProperty("line.separator"); StringBuffer str = new StringBuffer(); int i = 0; while (i < len) { str.append(prefix); str.append(Util.formatInt(i+off, 16, 8)); str.append("  "); String s = Util.toHexString(buf, i+off, Math.min(16, len-i), ' '); str.append(s); for (int j = 56 - (56 - s.length()); j < 56; j++) str.append(" "); for (int j = 0; j < Math.min(16, len - i); j++) { if ((buf[i+off+j] & 0xFF) < 0x20 || (buf[i+off+j] & 0xFF) > 0x7E) str.append('.'); else str.append((char) (buf[i+off+j] & 0xFF)); } str.append(nl); i += 16; } return str.toString();
  public static String hexDump(byte[] buf, String prefix)  {    return hexDump(buf, 0, buf.length, prefix);  }