docs: private void writeString(String string) throws JSONException {
  
  // Special case for empty strings.
  
          if (string.length() == 0) {
              zero();
              write(end, this.stringhuff);
          } else {
              Kim kim = new Kim(string);
  
  // Look for the string in the strings keep. If it is found, emit its
  // integer and count that as a use.
  
              int integer = this.stringkeep.find(kim);
              if (integer != none) {
                  one();
                  write(integer, this.stringkeep);
              } else {
  
  // But if it is not found, emit the string's characters. Register the string
  // so that a later lookup can succeed.
  
                  zero();
                  write(kim, this.stringhuff, this.stringhuffext);
                  write(end, this.stringhuff);
                  this.stringkeep.register(kim);
              }
          }
      }