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
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
ConstructorDescriptionConstruct a newLeadPipeInputStream
.LeadPipeInputStream
(int size) Construct a newLeadPipeInputStream
with the specified buffer size.Construct a newLeadPipeInputStream
to pull from the specifiedPipedOutputStream
.LeadPipeInputStream
(PipedOutputStream src, int size) Construct a newLeadPipeInputStream
to pull from the specifiedPipedOutputStream
, using a circular buffer of the specified size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Set a managingProjectComponent
for thisLeadPipeInputStream
.void
setManagingTask
(Task task) Set a managingTask
for thisLeadPipeInputStream
.Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
LeadPipeInputStream
public LeadPipeInputStream()Construct a newLeadPipeInputStream
. -
LeadPipeInputStream
public LeadPipeInputStream(int size) Construct a newLeadPipeInputStream
with the specified buffer size.- Parameters:
size
- the size of the circular buffer.
-
LeadPipeInputStream
Construct a newLeadPipeInputStream
to pull from the specifiedPipedOutputStream
.- Parameters:
src
- thePipedOutputStream
source.- Throws:
IOException
- if unable to construct the stream.
-
LeadPipeInputStream
Construct a newLeadPipeInputStream
to pull from the specifiedPipedOutputStream
, using a circular buffer of the specified size.- Parameters:
src
- thePipedOutputStream
source.size
- the size of the circular buffer.- Throws:
IOException
- if there is an error.
-
-
Method Details
-
read
Read a byte from the stream.- Overrides:
read
in classPipedInputStream
- 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
Set a managingTask
for thisLeadPipeInputStream
.- Parameters:
task
- the managingTask
.
-
setManagingComponent
Set a managingProjectComponent
for thisLeadPipeInputStream
.- Parameters:
pc
- the managingProjectComponent
.
-
log
Log a message with the specified logging level.- Parameters:
message
- theString
message.loglevel
- theint
logging level.
-