docs: public Writer write(Writer writer) throws JSONException {
          try {
              if (m_map.isEmpty()) {
                  writer.write("{}");
                  return writer;
              }
              // This prefix value applies to the first key only
              String keyprefix = "{\"";
              for (Entry<String, Object> entry : m_map.entrySet()) {
                  writer.write(keyprefix);
                  writer.write(quotable(entry.getKey()));
                  writer.write("\":");
                  Object v = entry.getValue();
                  if (v instanceof JSONObject) {
                      ((JSONObject)v).write(writer);
                  }
                  else if (v instanceof JSONArray) {
                      ((JSONArray)v).write(writer);
                  }
                  else {
                      writer.write(valueToString(v));
                  }
                  // This prefix value applies to all subsequent keys
                  keyprefix = ",\"";
              }
              writer.write('}');
              return writer;
          }
          catch (IOException exception) {
              throw new JSONException(exception);
          }
       }