title: java image output to zip file using FileSystem is empty
body: <p>I am currently trying copy an image file to an existing zip file (like appending it). But the output is empty (meaning: The file actually even exists - it is just shown as taking 0 bytes and it cannot be opened / extracted). </p>
  
  <p>Here is my code sample:</p>
  
  <pre><code>Map&lt;String, String&gt; env = new HashMap&lt;&gt;();
  env.put("create", "true");
  Path path = Paths.get("countMap.zip");
  java.net.URI uri = java.net.URI.create("jar:" + path.toUri());
  
  try (FileSystem fs = FileSystems.newFileSystem(uri, env)) {
  
  Path nf = fs.getPath("mario.png");
  
  try (OutputStream zos = Files.newOutputStream(nf, StandardOpenOption.CREATE)) {
  
              Files.createFile(nf, null);
  
              Files.copy(nf, zos);
  
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>EDIT: </p>
  
  <p>When I debug the java components it looks like everything would be fine. I wonder if there can be some issues with copying a temporary file to the final file destination.</p>