code: public void escape(StringBuilder sb, String str) {
          int len = str.length();
          for (int i = 0; i < len; i++) {
              char c = str.charAt(i);
              String entityName = this.entityName(c);
              if (entityName == null) {
                  if (c > 0x7F) {
                      sb.append("&#");
                      sb.append(Integer.toString(c, 10));
                      sb.append(';');
                  } else {
                      sb.append(c);
                  }
              } else {
                  sb.append('&');
                  sb.append(entityName);
                  sb.append(';');
              }
          }
      }
docs: <p>
  Escapes the characters in the <code>String</code> passed and writes the result to the <code>StringBuilder</code>
  passed.
  </p>
  
  @param sb
  The <code>StringBuilder</code> to write the results of the escaping to. Assumed to be a non-null value.
  @param str
  The <code>String</code> to escape. Assumed to be a non-null value.
  
  @see #escape(String)
  @see java.lang.StringBuilder