Class BetterFileOutputStream
java.lang.Object
java.io.OutputStream
java.io.FileOutputStream
clazzfish.monitor.io.BetterFileOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Whenever you need a
FileOutputStream
and want a better toString
implementation you can use the class BetterFileOutputStream. "Better" means
that you see the name if the input file in the log which is much more helpful
than the default implementation of Object.toString()
, especially for
logging and debugging.
Originally this class was part of the PatternTesting project.
- Author:
- oliver (boehm@javatux.de)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBetterFileOutputStream
(File file) Instantiates a new better file output stream.BetterFileOutputStream
(File file, boolean append) Instantiates a new better file output stream.BetterFileOutputStream
(String name) Instantiates a new better file output stream.BetterFileOutputStream
(String name, boolean append) Instantiates a new better file output stream. -
Method Summary
Modifier and TypeMethodDescriptiontoString()
This toString implementation reports the name of the output file which is much more helpful than the default implementation ofObject.toString()
, especially for logging and debugging.Methods inherited from class java.io.FileOutputStream
close, getChannel, getFD, write, write, write
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Constructor Details
-
BetterFileOutputStream
Instantiates a new better file output stream.- Parameters:
name
- the file name- Throws:
FileNotFoundException
- the file not found exception- See Also:
-
BetterFileOutputStream
Instantiates a new better file output stream.- Parameters:
file
- the file- Throws:
FileNotFoundException
- the file not found exception- See Also:
-
BetterFileOutputStream
Instantiates a new better file output stream.- Parameters:
name
- the file nameappend
- if it should be appended- Throws:
FileNotFoundException
- the file not found exception- See Also:
-
BetterFileOutputStream
Instantiates a new better file output stream.- Parameters:
file
- the fileappend
- if it should be appended- Throws:
FileNotFoundException
- the file not found exception- See Also:
-
-
Method Details
-
toString
This toString implementation reports the name of the output file which is much more helpful than the default implementation ofObject.toString()
, especially for logging and debugging.
-