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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-