private FormData readFormData_wwwFormURLEncoded( String contentType,
						     HeaderParams headerParams ) 
	throws IOException,
	       HeaderFormatException,
	       DataFormatException,
	       UnsupportedFormatException {


	// Retrieve the Content-Length header from the request to determine the number of bytes expected to read.
	Long contentLength = this.getRequestHeaders().getLongValue( HTTPHeaders.NAME_CONTENT_LENGTH );
	if( contentLength == null )
	    throw new HeaderFormatException( "Cannot read form data. No (valid) 'Content-Length' header present." );
	


	ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); 
	this.getLogger().log( Level.FINE,
			      getClass().getName() + ".readFormData_wwwFormURLEncoded()",
			      "Going to read " + contentLength + " bytes from POST data input stream ..." );
	long totalLength = CustomUtil.transfer( this.getInputStream(),
						byteArrayOutput,
						contentLength.longValue(),                // maxReadLength
						Math.min(1024, contentLength.intValue())  // bufferSize
						);
						



	String urlEncoded = new String( byteArrayOutput.toByteArray() );
	this.getLogger().log( Level.FINE,
			      getClass().getName() + ".readFormData_wwwFormURLEncoded()",
			      "POST data read, url-encoded: " + urlEncoded );


	String acceptEncoding = this.getRequestHeaders().getStringValue( HTTPHeaders.NAME_ACCEPT_CHARSET );
	if( acceptEncoding == null ) {

	    // Default charset is ISO-8859-1.
	    // This is ugly. I want to use UTF-8 :((
	    //acceptEncoding = "ISO-8859-1";  
	    acceptEncoding = java.nio.charset.StandardCharsets.ISO_8859_1.name();
	    this.getLogger().log( Level.INFO,
				  getClass().getName() + ".readFormData_wwwFormURLEncoded()",
				  "The header" + HTTPHeaders.NAME_ACCEPT_CHARSET + " is not present. Using default value '" + acceptEncoding + "'." );

	}



	HeaderParams acceptParams = new HeaderParams( HTTPHeaders.NAME_ACCEPT_CHARSET, acceptEncoding ); 
	String charset = acceptParams.getToken( 0, 0 );
	try {

	    this.getLogger().log( Level.INFO,
				  getClass().getName() + ".readFormData_wwwFormURLEncoded()",
				  "Processing POST data using charset '" + charset + "' ..." );
	    // Decode and parse the form data  
	    Query query = new Query( urlEncoded, 
				     charset,    // The url's charset
				     false       // no case sensitive mapping
				     );


	    // Build form data directly from query
	    //FormData formData = new QueryFormDataDelegation( query );
	    FormData formData = new DefaultFormData();
	    HTTPHeaders queryHeaders = new HTTPHeaders();
	    Iterator<String> keyIter = query.keyIterator();
	    while( keyIter.hasNext() ) {

		String tmpKey   = keyIter.next();
		String tmpValue = query.getParam( tmpKey );
		queryHeaders.add( new HTTPHeaderLine(tmpKey,tmpValue) );

	    }
	    FormDataItem item = new FormDataItem( queryHeaders, this.getInputStream() );
	    formData.add( item );


	    this.getLogger().log( Level.FINE,
				  getClass().getName() + ".readFormData_wwwFormURLEncoded()",
				  "POST form data retrieved: " + formData );

	    return formData;
	
	} catch( UnsupportedEncodingException e ) {

	    this.getLogger().log( Level.INFO,
				  getClass().getName() + ".readFormData_wwwFormURLEncoded()",
				  "Going to read " + contentLength + " bytes from POST data input stream ..." );
	    throw new UnsupportedFormatException( "Unsupported encoding for POST data '" + charset + "' (" + e.getMessage() + ")." );

	}

    }