code: public static void join(Writer writer, Iterator<? extends EncodedPair> pairs, char pairSep, char nameValSep, boolean quoteName, boolean quoteVal) throws IOException {
          boolean first = true;
          while(pairs.hasNext()) {
              EncodedPair httpEncodedPair = pairs.next();
              if(!first) {
                  writer.append(pairSep);
              }
  
              if(quoteName) {
                  writer.append('\"').append(httpEncodedPair.getName()).append('\"');
              }else{
                  writer.append(httpEncodedPair.getName());
              }
  
              writer.append(nameValSep);
  
              if(quoteVal) {
                  writer.append('\"').append(httpEncodedPair.getValue()).append('\"');
              }else{
                  writer.append(httpEncodedPair.getValue());
              }
  
              first = false;
          }
      }
docs: Joins the given iterator of encoded pairs using nameValSep for name/value separator and pairSep for pair separator.
  @param writer where the joined pairs are written
  @param pairs list of encoded pair to join
  @param pairSep character to use to join pairs
  @param nameValSep character to use to join name/value for each pair
  @param quoteName if true, will double quote the name while joining
  @param quoteVal if true, will double quote the value while joining
  @throws IOException If an exception occures while writing to the writer