title: delete file after reading into inputstream
body: <p>I am trying to retrieve a video stream from a file stored locally. After reading into an inputstream, I am trying to delete the file but it does not allow this to happen. I understand that I need to close the stream, but I need to pass this stream on to a webserver call. Any ideas on how to best approach this:</p>
  
  <pre><code>InputStream is = new FileInputStream("\\Location\\file.txt");
  File f = new File("\\Location\\file.txt");
  
               if(f.delete()) {
                  System.out.println("success");
               } else {
                  System.out.println("failure");
               }  
  </code></pre>