docs: public static void write(Writer out, Object object) throws IOException {
          if (object instanceof String) {
              out.write((String) object);
          } else if (object instanceof Object[]) {
              out.write(toArrayString((Object[]) object));
          } else if (object instanceof Map) {
              out.write(toMapString((Map) object));
          } else if (object instanceof Collection) {
              out.write(toListString((Collection) object));
          } else if (object instanceof Writable) {
              Writable writable = (Writable) object;
              writable.writeTo(out);
          } else if (object instanceof InputStream || object instanceof Reader) {
              // Copy stream to stream
              Reader reader;
              if (object instanceof InputStream) {
                  reader = new InputStreamReader((InputStream) object);
              } else {
                  reader = (Reader) object;
              }
  
              try (Reader r = reader) {
                  char[] chars = new char[8192];
                  for (int i; (i = r.read(chars)) != -1; ) {
                      out.write(chars, 0, i);
                  }
              }
          } else {
              out.write(toString(object));
          }
      }