title: Delete file after staring connection using FileInputStream
body: <p>I have a temporary file which I want to send the client from the controller in the Play Framework. Can I delete the file after opening a connection using FileInputStream? For example can I do something like this - </p>
  
  <pre><code>File file = getFile();
  InputStream is = new FileInputStream(file);
  file.delete();
  renderBinary(is, "name.txt");
  </code></pre>
  
  <p>What if file is a large file? If I delete the file, will subsequent reads() on InputStream give an error? I have tried with files of around 1MB I don't get an error.</p>
  
  <p>Sorry if this is a very naive question, but I could not find anything related to this and I am pretty new to Java</p>