code: protected void appendParameters(StringBuilder buffer,String parameters)
      {
          if((parameters!=null)&&(parameters.length()>0))
          {
              String updatedParameters=parameters;
              if(parameters.startsWith("?"))
              {
                  updatedParameters=parameters.substring(1);
              }
              
              if(updatedParameters.length()>0)
              {
                  int currentLength=buffer.length();
                  if((currentLength>0)&&(buffer.charAt(currentLength-1)=='/'))
                  {
                      int length=currentLength;
                      buffer.delete(length-1,length);
                  }
                  
                  //add separator
                  buffer.append("?");
      
                  try
                  {
                      String[] parameterPairs=updatedParameters.split("&");
                      int amount=parameterPairs.length;
                      String parameterPair=null;
                      String[] values=null;
                      boolean addedParameters=false;
                      for(int index=0;index<amount;index++)
                      {
                          //get next element
                          parameterPair=parameterPairs[index];
                          
                          //split to key/value
                          values=parameterPair.split("=");
                          if(values.length==2)
                          {
                              if(addedParameters)
                              {
                                  buffer.append("&");
                              }
                              
                              buffer.append(URLEncoder.encode(values[0],"UTF-8"));
                              buffer.append("=");
                              buffer.append(URLEncoder.encode(values[1],"UTF-8"));
                              
                              //set flag
                              addedParameters=true;
                          }
                      }
                  }
                  catch(Exception exception)
                  {
                      throw new FaxException("Unable to encode parameters.",exception);
                  }
              }
          }
      }
docs: This function appends the parameters text to the base URL.
  
  @param   buffer
  The buffer to update
  @param   parameters
  The parameters line