org.apache.tools.ant.util

Class KeepAliveInputStream

public class KeepAliveInputStream extends FilterInputStream

Class that can be used to wrap System.in without getting anxious about any client closing the stream.

In code-language it means that it is not necessary to do:

 if (out != System.in) {
   in.close();
 }
 

Since: Ant 1.6

Constructor Summary
KeepAliveInputStream(InputStream in)
Constructor of KeepAliveInputStream.
Method Summary
voidclose()
This method does nothing.
static InputStreamwrapSystemIn()
Convenience factory method that returns a non-closing InputStream around System.in.

Constructor Detail

KeepAliveInputStream

public KeepAliveInputStream(InputStream in)
Constructor of KeepAliveInputStream.

Parameters: in an InputStream value, it should be standard input.

Method Detail

close

public void close()
This method does nothing.

Throws: IOException as we are overridding FilterInputStream.

wrapSystemIn

public static InputStream wrapSystemIn()
Convenience factory method that returns a non-closing InputStream around System.in.

Since: Ant 1.8.0