* @param input
   */
  public static void writeHtmlEscapingUrlSpecialCharacters(PrintableStringWriter stream, String input) {
    { char ch = Stella.NULL_CHARACTER;
      String vector000 = input;
      int index000 = 0;
      int length000 = vector000.length();

      for (;index000 < length000; index000 = index000 + 1) {
        ch = vector000.charAt(index000);
        if ((Stella.$CHARACTER_TYPE_TABLE$[(int) ch] == Stella.KWD_LETTER) ||
            (Stella.$CHARACTER_TYPE_TABLE$[(int) ch] == Stella.KWD_DIGIT)) {
          stream.print(ch);
        }
        else {
          switch (ch) {
            case '-': 
            case '_': 
            case '.': 
            case '~': 
              stream.print(ch);
            break;
            default:
              { int code = (int) ch;

                if (code < 16) {
                  stream.print("%0" + Native.integerToHexString(((long)(code))));
                }
                else {
                  stream.print("%" + Native.integerToHexString(((long)(code))));
                }
              }
            break;
          }
        }
      }
    }
    return;
  }