Package org.apache.tools.ant.util
Class KeepAliveOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.tools.ant.util.KeepAliveOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
Class that can be used to wrap 
System.out and System.err
 without getting anxious about any client closing the stream.
 In code-language it means that it is not necessary to do:
 if (out != System.out && out != System.err) {
   out.close();
 }
 - 
Field SummaryFields inherited from class java.io.FilterOutputStreamout
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor of KeepAliveOutputStream.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()This method does nothing.static PrintStreamConvenience factory method that returns a non-closing PrintStream around System.err.static PrintStreamConvenience factory method that returns a non-closing PrintStream around System.out.Methods inherited from class java.io.FilterOutputStreamflush, write, write, writeMethods inherited from class java.io.OutputStreamnullOutputStream
- 
Constructor Details- 
KeepAliveOutputStreamConstructor of KeepAliveOutputStream.- Parameters:
- out- an OutputStream value, it should be standard output.
 
 
- 
- 
Method Details- 
closeThis method does nothing.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- FilterOutputStream
- Throws:
- IOException- as we are overriding FilterOutputStream.
 
- 
wrapSystemOutConvenience factory method that returns a non-closing PrintStream around System.out.- Returns:
- PrintStream
- Since:
- Ant 1.8.0
 
- 
wrapSystemErrConvenience factory method that returns a non-closing PrintStream around System.err.- Returns:
- PrintStream
- Since:
- Ant 1.8.0
 
 
-