Index: src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 227)
+++ src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 228)
@@ -5,4 +5,7 @@
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.util.zip.Inflater;
+import java.util.zip.InflaterInputStream;
+import java.util.zip.GZIPInputStream;
 
 import org.openstreetmap.josm.Main;
@@ -10,5 +13,9 @@
 
 /**
- * This DataReader read directly from the REST API of the osm server.
+ * This DataReader reads directly from the REST API of the osm server.
+ * 
+ * It supports plain text transfer as well as gzip or deflate encoded transfers;
+ * if compressed transfers are unwanted, set property osm-server.use-compression
+ * to false.
  *
  * @author imi
@@ -32,9 +39,22 @@
 			return null;
 		}
+		
+		if (Boolean.parseBoolean(Main.pref.get("osm-server.use-compression", "true")))
+			activeConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");
+
 		System.out.println("got return: "+activeConnection.getResponseCode());
 		activeConnection.setConnectTimeout(15000);
 		if (isAuthCancelled() && activeConnection.getResponseCode() == 401)
 			return null;
-		return new ProgressInputStream(activeConnection, pleaseWaitDlg);
+
+		String encoding = activeConnection.getContentEncoding();
+		InputStream inputStream = new ProgressInputStream(activeConnection, pleaseWaitDlg);
+		if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
+			inputStream = new GZIPInputStream(inputStream);
+		}
+		else if (encoding != null && encoding.equalsIgnoreCase("deflate")) {
+			inputStream = new InflaterInputStream(inputStream, new Inflater(true));
+		}
+		return inputStream;
 	}
 }
