code: public static String dumpString(byte[] b) {
      StringBuilder d = new StringBuilder(b.length * 2);
      for (byte aB : b) {
        char c = (char) aB;
        if (Character.isISOControl(c)) {
          switch (c) {
            case '\r':
              d.append("{CR}");
              break;
            case '\n':
              d.append("{LF}");
              break;
            case '\000':
              d.append("{NULL}");
              break;
            default:
              char hi = Character.forDigit((aB >> 4) & 0x0F, 16);
              char lo = Character.forDigit(aB & 0x0F, 16);
              d.append('[').append(Character.toUpperCase(hi)).append(Character.toUpperCase(lo)).append(']');
              break;
          }
        } else
          d.append(c);
  
      }
      return d.toString();
    }
docs: converts a byte array to printable characters
  
  @param b - byte array
  @return String representation