org.apache.tools.ant.util

Class LeadPipeInputStream

public class LeadPipeInputStream extends PipedInputStream

Special PipedInputStream that will not die when the writing Thread is no longer alive.

Since: Ant 1.6.2

Constructor Summary
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
voidlog(String message, int loglevel)
Log a message with the specified logging level.
intread()
Read a byte from the stream.
voidsetBufferSize(int size)
Set the size of the buffer.
voidsetManagingComponent(ProjectComponent pc)
Set a managing ProjectComponent for this LeadPipeInputStream.
voidsetManagingTask(Task task)
Set a managing Task for this LeadPipeInputStream.

Constructor Detail

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)
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)
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 Detail

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.

read

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

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.

setManagingComponent

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

Parameters: pc the managing ProjectComponent.

setManagingTask

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

Parameters: task the managing Task.