public void format(final StringBuffer buffer,final NameValuePair param){
  if (buffer == null) {
    throw new IllegalArgumentException("String buffer may not be null");
  }
  if (param == null) {
    throw new IllegalArgumentException("Parameter may not be null");
  }
  buffer.append(param.getName());
  final String value=param.getValue();
  if (value != null) {
    buffer.append("=");
    formatValue(buffer,value,alwaysUseQuotes);
  }
}

public void format ( final StringBuffer buffer , final NameValuePair param ) { if ( buffer == null ) { throw new IllegalArgumentException ( "String buffer may not be null" ) ; } if ( param == null ) { throw new IllegalArgumentException ( "Parameter may not be null" ) ; } buffer . append ( param . getName ( ) ) ; final String value = param . getValue ( ) ; if ( value != null ) { buffer . append ( "=" ) ; formatValue ( buffer , value , alwaysUseQuotes ) ; } }
produces textual representaion of the attribute / value pair using formatting rules defined in rfc 2616
