Package de.intarsys.tools.stream
Class TempFileOutputStream
java.lang.Object
java.io.OutputStream
de.intarsys.tools.stream.TempFileOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
A stream wrapper that deferrs writing to the final destination until the
stream is closed. The output is written to a temporary file in the
destinations directory. When the stream is closed, the temp file is copied to
the destination and deleted.
-
Constructor Summary
ConstructorsConstructorDescriptionTempFileOutputStream(File destination) TempFileOutputStream(File destination, String prefix, String suffix) -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
TempFileOutputStream
- Throws:
IOException
-
TempFileOutputStream
- Throws:
IOException
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-