Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java	(revision 16815)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java	(revision 16816)
@@ -9,5 +9,5 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.nio.file.Files;
+import java.io.InputStream;
 import java.nio.file.NoSuchFileException;
 import java.nio.file.Paths;
@@ -36,4 +36,5 @@
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.mappaint.RenderingHelper.StyleData;
+import org.openstreetmap.josm.io.Compression;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.io.OsmReader;
@@ -572,6 +573,6 @@
             throw new IllegalArgumentException(tr("Missing argument - input data file ({0})", "--input|-i"));
         }
-        try {
-            return OsmReader.parseDataSet(Files.newInputStream(Paths.get(argInput)), null);
+        try (InputStream inputStream = Compression.getUncompressedFileInputStream(Paths.get(argInput))) {
+            return OsmReader.parseDataSet(inputStream, null);
         } catch (IllegalDataException e) {
             throw new IllegalDataException(tr("In .osm data file ''{0}'' - ", argInput) + e.getMessage(), e);
Index: /trunk/src/org/openstreetmap/josm/io/Compression.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/Compression.java	(revision 16815)
+++ /trunk/src/org/openstreetmap/josm/io/Compression.java	(revision 16816)
@@ -9,4 +9,5 @@
 import java.nio.file.Files;
 import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
 import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
@@ -177,13 +178,24 @@
     public static InputStream getUncompressedFileInputStream(File file) throws IOException {
         try {
-            InputStream in = Files.newInputStream(file.toPath()); // NOPMD
-            try {
-                return byExtension(file.getName()).getUncompressedInputStream(in);
-            } catch (IOException e) {
-                Utils.close(in);
-                throw e;
-            }
+            return getUncompressedFileInputStream(file.toPath());  // NOPMD
         } catch (InvalidPathException e) {
             throw new IOException(e);
+        }
+    }
+
+    /**
+     * Returns an un-compressing {@link InputStream} for the {@link Path} {@code path}.
+     * @param path path
+     * @return un-compressing input stream
+     * @throws IOException if any I/O error occurs
+     * @since 16816
+     */
+    public static InputStream getUncompressedFileInputStream(Path path) throws IOException {
+        InputStream in = Files.newInputStream(path); // NOPMD
+        try {
+            return byExtension(path.getFileName().toString()).getUncompressedInputStream(in);
+        } catch (IOException e) {
+            Utils.close(in);
+            throw e;
         }
     }
@@ -221,7 +233,20 @@
      */
     public static OutputStream getCompressedFileOutputStream(File file) throws IOException {
-        OutputStream out = Files.newOutputStream(file.toPath()); // NOPMD
+        return getCompressedFileOutputStream(file.toPath()); // NOPMD
+    }
+
+    /**
+     * Returns a compressing {@link OutputStream} for the {@link Path} {@code path}.
+     * @param path path
+     * @return compressing output stream
+     *
+     * @throws IOException if any I/O error occurs
+     * @throws InvalidPathException if a Path object cannot be constructed from the abstract path
+     * @since 16816
+     */
+    public static OutputStream getCompressedFileOutputStream(Path path) throws IOException {
+        OutputStream out = Files.newOutputStream(path); // NOPMD
         try {
-            return byExtension(file.getName()).getCompressedOutputStream(out);
+            return byExtension(path.getFileName().toString()).getCompressedOutputStream(out);
         } catch (IOException e) {
             Utils.close(out);
