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:
- java.io.Closeable,- java.io.Flushable,- java.lang.AutoCloseable
 
 public class KeepAliveOutputStream extends java.io.FilterOutputStreamClass that can be used to wrapSystem.outandSystem.errwithout 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(); }
- 
- 
Constructor SummaryConstructors Constructor Description KeepAliveOutputStream(java.io.OutputStream out)Constructor of KeepAliveOutputStream.
 - 
Method SummaryModifier and Type Method Description voidclose()This method does nothing.static java.io.PrintStreamwrapSystemErr()Convenience factory method that returns a non-closing PrintStream around System.err.static java.io.PrintStreamwrapSystemOut()Convenience factory method that returns a non-closing PrintStream around System.out.
 
- 
- 
- 
Method Detail- 
closepublic void close() throws java.io.IOExceptionThis method does nothing.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- java.io.FilterOutputStream
- Throws:
- java.io.IOException- as we are overriding FilterOutputStream.
 
 - 
wrapSystemOutpublic static java.io.PrintStream wrapSystemOut() Convenience factory method that returns a non-closing PrintStream around System.out.- Returns:
- PrintStream
- Since:
- Ant 1.8.0
 
 - 
wrapSystemErrpublic static java.io.PrintStream wrapSystemErr() Convenience factory method that returns a non-closing PrintStream around System.err.- Returns:
- PrintStream
- Since:
- Ant 1.8.0
 
 
- 
 
-