code: public static CharBuf sputs(CharBuf buf, Object... messages) {
          int index = 0;
          for (Object message : messages) {
              if (index != 0) {
                  buf.add(' ');
              }
              index++;
              if (message == null) {
                  buf.add("<NULL>");
              } else if (message instanceof char[]) {
                  buf.add(((char[]) message));
              } else if (message.getClass().isArray()) {
                  buf.add(toListOrSingletonList(message).toString());
              } else {
                  buf.add(message.toString());
              }
          }
          buf.add('\n');
          return buf;
      }
  
      public static StringBuilder sputs(StringBuilder buf, Object... messages) {
  
          int index = 0;
          for (Object message : messages) {
              if (index != 0) {
                  buf.append(' ');
              }
              index++;
  
              if (message == null) {
                  buf.append("<NULL>");
              } else if (message.getClass().isArray()) {
                  buf.append(toListOrSingletonList(message).toString());
              } else {
                  buf.append(message.toString());
              }
          }
          buf.append('\n');
  
          return buf;
  
      }
  
      public static String toPrettyJson(Object object) {
  
          CharBuf buf = CharBuf.createCharBuf();
          return buf.prettyPrintObject(object, false, 0).toString();
      }
  
      public static String toPrettyJsonWithTypes(Object object) {
  
          CharBuf buf = CharBuf.createCharBuf();
          return buf.prettyPrintObject(object, true, 0).toString();
      }
  }
docs: Like puts but writes to a CharBuf.
  
  @param buf      char buf
  @param messages messages to write.
  @return string created.