Package net.solarnetwork.io
Class DeleteOnCloseFileInputStream
java.lang.Object
java.io.InputStream
java.io.FileInputStream
net.solarnetwork.io.DeleteOnCloseFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Extension of
FileInputStream that deletes the file once
close() is called.- Since:
- 1.43
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FileInputStream
available, getChannel, getFD, read, read, read, readAllBytes, readNBytes, skipMethods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
DeleteOnCloseFileInputStream
Construct with a file.- Parameters:
file- the file to delete- Throws:
FileNotFoundException- if the file is not available
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFileInputStream- Throws:
IOException
-