code: private JSONWriter append(String string) throws JSONException {
          if (string == null) {
              throw new JSONException("Null pointer");
          }
          if (this.mode == 'o' || this.mode == 'a') {
              try {
                  if (this.comma && this.mode == 'a') {
                      this.writer.append(',');
                  }
                  this.writer.append(string);
              } catch (IOException e) {
              	// Android as of API 25 does not support this exception constructor
              	// however we won't worry about it. If an exception is happening here
              	// it will just throw a "Method not found" exception instead.
                  throw new JSONException(e);
              }
              if (this.mode == 'o') {
                  this.mode = 'k';
              }
              this.comma = true;
              return this;
          }
          throw new JSONException("Value out of sequence.");
      }
docs: Append a value.
  @param string A string value.
  @return this
  @throws JSONException If the value is out of sequence.