Package io.milton.common
Class FileDeletingInputStream
java.lang.Object
java.io.InputStream
io.milton.common.FileDeletingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An inputstream to read a file, and to delete the file when this stream is closed
This is useful for situations where you are using a local file to buffer the contents
of remote data, and want to ensure that the temporary local file is deleted when
it is no longer being used
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferTo
-
Constructor Details
-
FileDeletingInputStream
- Throws:
FileNotFoundException
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
finalize
-