docs: private void appendValue(String string) throws JSONException {
          assert string != null;
          if (m_mode == 'k' || m_mode == 'i' || m_mode == 'd') {
              throw new JSONException("Value out of sequence.");
          }
          try {
              if (m_mode == 'a') {
                  if (m_expectingComma) {
                      m_writer.write(',');
                  }
              }
              else if (m_mode == 'o') {
                  m_mode = 'k';
              }
              m_writer.write(string);
          }
          catch (IOException e) {
              throw new JSONException(e);
          }
          m_expectingComma = true;
      }