Top Description Fields Constructors Methods
org.apache.tools.ant.util

public Class KeepAliveInputStream

extends FilterInputStream
Class Inheritance
Imports
java.io.FilterInputStream, .IOException, .InputStream

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

Field Summary

Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
public
KeepAliveInputStream(InputStream
an InputStream value, it should be standard input.
in
)

Constructor of KeepAliveInputStream.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

This method does nothing.
public static InputStream

Returns:

InputStream
wrapSystemIn
()

Convenience factory method that returns a non-closing InputStream around System.in.

Inherited from java.io.FilterInputStream:
availablemarkmarkSupportedreadreadreadresetskip

Constructor Detail

KeepAliveInputStreamback to summary
public KeepAliveInputStream(InputStream in)

Constructor of KeepAliveInputStream.

Parameters
in:InputStream

an InputStream value, it should be standard input.

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

This method does nothing.

Exceptions
IOException:
as we are overriding FilterInputStream.
wrapSystemInback to summary
public static InputStream wrapSystemIn()

Convenience factory method that returns a non-closing InputStream around System.in.

Returns:InputStream

InputStream

Since
Ant 1.8.0