private static void percentEncoder(final String urlElement,final StringBuilder encodedBuffer){
  Reject.ifNull(urlElement);
  for (int count=0; count < urlElement.length(); count++) {
    final char c=urlElement.charAt(count);
    if (VALID_CHARS.contains(c)) {
      encodedBuffer.append(c);
    }
 else {
      encodedBuffer.append(PERCENT_ENCODING_CHAR);
      encodedBuffer.append(Integer.toHexString(c));
    }
  }
}

private static void percentEncoder ( final String urlElement , final StringBuilder encodedBuffer ) { Reject . ifNull ( urlElement ) ; for ( int count = 0 ; count < urlElement . length ( ) ; count ++ ) { final char c = urlElement . charAt ( count ) ; if ( VALID_CHARS . contains ( c ) ) { encodedBuffer . append ( c ) ; } else { encodedBuffer . append ( PERCENT_ENCODING_CHAR ) ; encodedBuffer . append ( Integer . toHexString ( c ) ) ; } } }
this method performs the percent - encoding as defined in section 2 . 1 of rfc 3986 .
