public void saveRam() throws Exception {
		//   if (username == null) throw new Exception("No username provided");

		String params = "";
		String strUrl = url.toString();
		int questionPos = strUrl.indexOf("?");
		if (questionPos != -1) {
			params = "&" + strUrl.substring(questionPos + 1, strUrl.length());
		}

		System.out.println("Params: (" + url + ") " + params);

		url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile() + "?user=" + URLEncoder.encode(username));

		HttpURLConnection conn = (HttpURLConnection) url.openConnection();

		conn.setRequestMethod("POST");
		conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
		conn.setDoOutput(true);
		conn.setDoInput(true);

		conn.connect();

		DataOutputStream printout = new DataOutputStream(conn.getOutputStream());

		StringBuffer saveData = new StringBuffer("");
		byte[] ram = cart.getBatteryRam();

		for (int r = 0; r < cart.getBatteryRamSize(); r++) {
			saveData.append(hexByte(unsign(ram[r])));
		}
		//   saveData = URLEncoder.encode("Hel\0lo");

		String content = "romname=" + URLEncoder.encode(cart.getRomFilename()) + "&gamename=" + URLEncoder.encode(cart.getCartName()) + "&user=" + URLEncoder.encode(username) + "&datalength=" + (cart.getBatteryRamSize() * 2) + "&data0=" + saveData + params;

		System.out.println(content);

		printout.writeBytes(content);
		printout.flush ();
		printout.close ();

		conn.disconnect();

		DataInputStream input = new DataInputStream (conn.getInputStream());
		String str;
		while (null != ((str = input.readLine()))) {
			System.out.println(str);
		}

		System.out.println("OK!");
	}