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

public Class TaskOutputStream

extends OutputStream
Class Inheritance
Annotations
@Deprecated
Imports
java.io.IOException, .OutputStream, org.apache.tools.ant.Task

Deprecated

since 1.2.x. Use LogOutputStream instead.

Redirects text written to a stream through the standard Ant logging mechanism. This class is useful for integrating with tools that write to System.out and System.err. For example, the following will cause all text written to System.out to be logged with "info" priority:
System.setOut(new PrintStream(new TaskOutputStream(project, Project.MSG_INFO)));

As of Ant 1.2, this class is considered to be dead code by the Ant developers and is unmaintained. Don't use it.

Field Summary

Modifier and TypeField and Description
private StringBuffer
private int
private Task

Constructor Summary

AccessConstructor and Description
pack-priv
TaskOutputStream(Task task, int msgOutputLevel)

Constructs a new JavacOutputStream with the given project as the output source for messages.

Method Summary

Modifier and TypeMethod and Description
private void
processLine()

Processes a line of input and determines if an error occurred.

public void
write(int
the character to write
c
)

Implements abstract java.io.OutputStream.write.

Write a character to the output stream.
Inherited from java.io.OutputStream:
closeflushnullOutputStreamwritewrite

Field Detail

lineback to summary
private StringBuffer line
msgOutputLevelback to summary
private int msgOutputLevel
taskback to summary
private Task task

Constructor Detail

TaskOutputStreamback to summary
pack-priv TaskOutputStream(Task task, int msgOutputLevel)

Constructs a new JavacOutputStream with the given project as the output source for messages.

Method Detail

processLineback to summary
private void processLine()

Processes a line of input and determines if an error occurred.

writeback to summary
public void write(int c) throws IOException

Implements abstract java.io.OutputStream.write.

Write a character to the output stream. This method looks to make sure that there isn't an error being reported and will flush each line of input out to the project's log stream.

Parameters
c:int

the character to write

Exceptions
IOException:
on error