private URL buildAnnounceURL(Map<String, String> params)
		throws UnsupportedEncodingException, MalformedURLException {
		StringBuilder url = new StringBuilder(this.torrent.getAnnounceUrl());

		if (params.size() != 0) {
			url.append("?");
		}

		for (Map.Entry<String, String> param : params.entrySet()) {
			url.append(param.getKey())
				.append("=")
				.append(URLEncoder.encode(param.getValue(),
							Torrent.BYTE_ENCODING))
				.append("&");
		}

		return new URL(url.toString().substring(0, url.length()-1));
	}