Class PrintWriter_flushing

java.lang.Object
java.io.Writer
java.io.PrintWriter
eu.bandm.tools.util.PrintWriter_flushing
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class PrintWriter_flushing extends PrintWriter
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!