Package org.apache.tools.ant.util

# Class LeadPipeInputStream

java.lang.Object
java.io.InputStream
java.io.PipedInputStream
org.apache.tools.ant.util.LeadPipeInputStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

public class LeadPipeInputStream extends PipedInputStream
Special `PipedInputStream` that will not die when the writing `Thread` is no longer alive.

Since:
  Ant 1.6.2

## Field Summary

### Fields inherited from class java.io.PipedInputStream

`buffer, in, out, PIPE_SIZE`

## Constructor Summary

Constructors
Constructor
Description
`LeadPipeInputStream()`
Construct a new `LeadPipeInputStream`.
`LeadPipeInputStream(int size)`
Construct a new `LeadPipeInputStream` with the specified buffer size.
`LeadPipeInputStream(PipedOutputStream src)`
Construct a new `LeadPipeInputStream` to pull from the specified `PipedOutputStream`.
`LeadPipeInputStream(PipedOutputStream src, int size)`
Construct a new `LeadPipeInputStream` to pull from the specified `PipedOutputStream`, using a circular buffer of the specified size.

## Method Summary

Modifier and Type
Method
Description
`void`
`log(String message, int loglevel)`
Log a message with the specified logging level.
`int`
`read()`
Read a byte from the stream.
`void`
`setBufferSize(int size)`
Set the size of the buffer.
`void`
`setManagingComponent(ProjectComponent pc)`
Set a managing `ProjectComponent` for this `LeadPipeInputStream`.
`void`
`setManagingTask(Task task)`
Set a managing `Task` for this `LeadPipeInputStream`.

### Methods inherited from class java.io.PipedInputStream

`available, close, connect, read, receive`

### Methods inherited from class java.io.InputStream

`mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LeadPipeInputStream

public LeadPipeInputStream()
Construct a new `LeadPipeInputStream`.

### LeadPipeInputStream

public LeadPipeInputStream(int size)
Construct a new `LeadPipeInputStream` with the specified buffer size.

Parameters:
  `size` - the size of the circular buffer.

### LeadPipeInputStream

public LeadPipeInputStream(PipedOutputStream src) throws IOException
Construct a new `LeadPipeInputStream` to pull from the specified `PipedOutputStream`.

Parameters:
  `src` - the `PipedOutputStream` source.
Throws:
  `IOException` - if unable to construct the stream.

### LeadPipeInputStream

public LeadPipeInputStream(PipedOutputStream src, int size) throws IOException
Construct a new `LeadPipeInputStream` to pull from the specified `PipedOutputStream`, using a circular buffer of the specified size.

Parameters:
  `src` - the `PipedOutputStream` source.
  `size` - the size of the circular buffer.
Throws:
  `IOException` - if there is an error.

## Method Details

### read

public int read() throws IOException
Read a byte from the stream.

Overrides:
  `read` in class `PipedInputStream`
Returns:
  the byte (0 to 255) or -1 if there are no more.
Throws:
  `IOException` - if there is an error.

### setBufferSize

public void setBufferSize(int size)
Set the size of the buffer.

Parameters:
  `size` - the new buffer size. Ignored if <= current size.

### setManagingTask

public void setManagingTask(Task task)
Set a managing `Task` for this `LeadPipeInputStream`.

Parameters:
  `task` - the managing `Task`.

### setManagingComponent

public void setManagingComponent(ProjectComponent pc)
Set a managing `ProjectComponent` for this `LeadPipeInputStream`.

Parameters:
  `pc` - the managing `ProjectComponent`.

### log

public void log(String message, int loglevel)
Log a message with the specified logging level.

Parameters:
  `message` - the `String` message.
  `loglevel` - the `int` logging level.