code: private static String replaceInvalidChars(String substring) {
          StringBuilder builder = new StringBuilder();
          for(char c : substring.toCharArray()) {
              if(c < 32) {
                  builder.append('.');
              } else {
                  builder.append(c);
              }
          }
          return builder.toString();
      }
docs: /*
  helper for logging binary content