String jvxlCompressString(String data) {
		/*
		 * just a simple compression, but allows 2000-6000:1 CUBE:JVXL for planes!
		 * 
		 * "X~nnn " means "nnn copies of character X"
		 * 
		 * ########## becomes "#~10 " ~ becomes "~~"
		 * 
		 */
		if (logCompression)
			Logger.info(data.length() + " compressing\n" + data);
		String dataOut = "";
		String dataBuffer = "";
		char chLast = '\0';
		data += '\0';
		int nLast = 0;
		for (int i = 0; i < data.length(); i++) {
			char ch = data.charAt(i);
			if (ch == chLast) {
				++nLast;
				dataBuffer += ch;
				if (ch != '~')
					ch = '\0';
			}
			else if (nLast > 0) {
				dataOut += (nLast < 4 || chLast == '~' || chLast == ' ' || chLast == '\t' ? dataBuffer : "~" + nLast
						+ " ");
				dataBuffer = "";
				nLast = 0;
			}
			if (ch != '\0') {
				dataOut += ch;
				chLast = ch;
			}
		}
		if (logCompression) {
			Logger.info(dataOut.length() + "\n" + dataOut);
			data = jvxlUncompressString(dataOut);
			Logger.info(data.length() + " uncompressing\n" + data);
		}
		return dataOut;
	}