code: public static void parse (
              final List <NameValuePair> parameters,
              final Scanner scanner,
              final String encoding) {
          scanner.useDelimiter(PARAMETER_SEPARATOR);
          while (scanner.hasNext()) {
              final String[] nameValue = scanner.next().split(NAME_VALUE_SEPARATOR);
              if (nameValue.length == 0 || nameValue.length > 2)
                  throw new IllegalArgumentException("bad parameter");
  
              final String name = decode(nameValue[0], encoding);
              String value = null;
              if (nameValue.length == 2)
                  value = decode(nameValue[1], encoding);
              parameters.add(new NameValuePair(name, value));
          }
      }
docs: Adds all parameters within the Scanner to the list of
  <code>parameters</code>, as encoded by <code>encoding</code>. For
  example, a scanner containing the string <code>a=1&b=2&c=3</code> would
  add the {@link NameValuePair NameValuePairs} a=1, b=2, and c=3 to the
  list of parameters.
  
  @param parameters
  List to add parameters to.
  @param scanner
  Input that contains the parameters to parse.
  @param encoding
  Encoding to use when decoding the parameters.