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

public Class LeadPipeInputStream

extends PipedInputStream
Class Inheritance
Imports
java.io.IOException, .PipedInputStream, .PipedOutputStream, org.apache.tools.ant.Project, .ProjectComponent, .Task

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

Field Summary

Modifier and TypeField and Description
private static final int
private ProjectComponent
Inherited from java.io.PipedInputStream:
bufferinoutPIPE_SIZE

Constructor Summary

AccessConstructor and Description
public
LeadPipeInputStream()

Construct a new LeadPipeInputStream.

public
LeadPipeInputStream(int
the size of the circular buffer.
size
)

Construct a new LeadPipeInputStream with the specified buffer size.

public
LeadPipeInputStream(PipedOutputStream
the PipedOutputStream source.
src
)

Construct a new LeadPipeInputStream to pull from the specified PipedOutputStream.

public
LeadPipeInputStream(PipedOutputStream
the PipedOutputStream source.
src
,
int
the size of the circular buffer.
size
)

Construct a new LeadPipeInputStream to pull from the specified PipedOutputStream, using a circular buffer of the specified size.

Method Summary

Modifier and TypeMethod and Description
public void
log(String
the String message.
message
,
int
the int logging level.
loglevel
)

Log a message with the specified logging level.

public synchronized int

Returns:

the byte (0 to 255) or -1 if there are no more.
read
()

Overrides java.io.PipedInputStream.read.

Read a byte from the stream.
public synchronized void
setBufferSize(int
the new buffer size. Ignored if <= current size.
size
)

Set the size of the buffer.

public void
setManagingComponent(ProjectComponent
the managing ProjectComponent.
pc
)

Set a managing ProjectComponent for this LeadPipeInputStream.

public void
setManagingTask(Task
the managing Task.
task
)

Set a managing Task for this LeadPipeInputStream.

Inherited from java.io.PipedInputStream:
availablecloseconnectreadreceive

Field Detail

BYTE_MASKback to summary
private static final int BYTE_MASK
managingPcback to summary
private ProjectComponent managingPc

Constructor Detail

LeadPipeInputStreamback to summary
public LeadPipeInputStream()

Construct a new LeadPipeInputStream.

LeadPipeInputStreamback to summary
public LeadPipeInputStream(int size)

Construct a new LeadPipeInputStream with the specified buffer size.

Parameters
size:int

the size of the circular buffer.

LeadPipeInputStreamback to summary
public LeadPipeInputStream(PipedOutputStream src) throws IOException

Construct a new LeadPipeInputStream to pull from the specified PipedOutputStream.

Parameters
src:PipedOutputStream

the PipedOutputStream source.

Exceptions
IOException:
if unable to construct the stream.
LeadPipeInputStreamback to summary
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:PipedOutputStream

the PipedOutputStream source.

size:int

the size of the circular buffer.

Exceptions
IOException:
if there is an error.

Method Detail

logback to summary
public void log(String message, int loglevel)

Log a message with the specified logging level.

Parameters
message:String

the String message.

loglevel:int

the int logging level.

readback to summary
public synchronized int read() throws IOException

Overrides java.io.PipedInputStream.read.

Read a byte from the stream.

Returns:int

the byte (0 to 255) or -1 if there are no more.

Annotations
@Override
Exceptions
IOException:
if there is an error.
setBufferSizeback to summary
public synchronized void setBufferSize(int size)

Set the size of the buffer.

Parameters
size:int

the new buffer size. Ignored if <= current size.

setManagingComponentback to summary
public void setManagingComponent(ProjectComponent pc)

Set a managing ProjectComponent for this LeadPipeInputStream.

Parameters
pc:ProjectComponent

the managing ProjectComponent.

setManagingTaskback to summary
public void setManagingTask(Task task)

Set a managing Task for this LeadPipeInputStream.

Parameters
task:Task

the managing Task.