Class TempFileInputStream

All Implemented Interfaces:
Disposable, Closeable, AutoCloseable

public class TempFileInputStream extends InputStreamDecorator<FileInputStream>
An input stream to a file that, when closed, deletes the file.

It is very important to properly close this output stream when finished using it; otherwise, orphaned temporary files may remain.

Author:
Garret Wilson
  • Constructor Details

    • TempFileInputStream

      public TempFileInputStream(File tempFile) throws FileNotFoundException
      File constructor.
      Parameters:
      tempFile - The temporary file to which an input stream should be created.
      Throws:
      NullPointerException - if the given file is null.
      FileNotFoundException - if the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
  • Method Details