title: PDF file with empty pages appearing after Copying using Java Files.copy
body: <p>I am trying to copy a file in my Class path to another temp location.</p>
  
  <p>Here is the code for it:</p>
  
  <pre><code>    InputStream inputStream = this.getClass().getClassLoader()
              .getResourceAsStream(readmeFile);
  
      Path path = Paths.get(tempFilesOutputPath + File.separator + readmeFile);
      try {
          Files.copy(inputStream, path, StandardCopyOption.REPLACE_EXISTING);
          inputStream.close();
  
      } catch (IOException e) {
          throw e;
      }
  </code></pre>
  
  <p>readMeFile has 2 pages, the copied file in the tempFilesOutputPath folder also has two pages but without any content. </p>
  
  <p>Please let me know if I am making some mistake or it has to be done in a different way.</p>
  
  <p>Cheers,
  Madhu</p>