title: Preserve file last modified date time while copying it from source to target
body: <p>I am trying to copy a file from one location to another. While copying it from source to target, target file is taking current date time. How can i make target file date as same as source file.</p>
  
  <pre><code>FileInputStream source = new FileInputStream("D:\\test\\test.txt");
  OutputStream target = new FileOutputStream("D:\\test.txt");
  byte[] buffer = new byte[source.available()];
  source.read(buffer);
  target.write(buffer);
  source.close();
  target.close();`
  </code></pre>