Package eu.bandm.tools.util.files
Class PrintWriter_flushing
java.lang.Object
java.io.Writer
java.io.PrintWriter
eu.bandm.tools.util.files.PrintWriter_flushing
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
Print writer which flushes the unerlying output stream after each print.
Convenient for debugging purpose, due to inconsistent java lib
flushing strategy.
Since the java io architecture has grown historically, the
PrintWriter.flush()
strategy is not always "fast enough" for
debugging purposes. Therefore this class patches the
PrintWriter.print(String)
and
PrintWriter.println(String)
methods to call flush()
immediately and "hard" as soon as their output is delivered.
Attention, beside these both methods no other output functions have been patched/overridden!
-
Field Summary
Fields inherited from class java.io.PrintWriter
out
-
Constructor Summary
ConstructorDescriptionTake the system-dependent standard encoding.PrintWriter_flushing
(OutputStream out, Charset encoding) Take the given encoding. -
Method Summary
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
Methods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
PrintWriter_flushing
Take the system-dependent standard encoding. (This should be an exceptional case, for tracing etc.) -
PrintWriter_flushing
Take the given encoding. This should nearly always be UTF_8.
-
-
Method Details
-
print
- Overrides:
print
in classPrintWriter
-
println
- Overrides:
println
in classPrintWriter
-