org.apache.tools.ant.util

Class TeeOutputStream

public class TeeOutputStream extends OutputStream

A simple T-piece to replicate an output stream into two separate streams
Constructor Summary
TeeOutputStream(OutputStream left, OutputStream right)
Constructor for TeeOutputStream.
Method Summary
voidclose()
Close both output streams.
voidflush()
Flush both output streams.
voidwrite(byte[] b)
Write a byte array to both output streams.
voidwrite(byte[] b, int off, int len)
Write a byte array to both output streams.
voidwrite(int b)
Write a byte to both output streams.

Constructor Detail

TeeOutputStream

public TeeOutputStream(OutputStream left, OutputStream right)
Constructor for TeeOutputStream.

Parameters: left one of the output streams. right the other output stream.

Method Detail

close

public void close()
Close both output streams.

Throws: IOException on error.

flush

public void flush()
Flush both output streams.

Throws: IOException on error

write

public void write(byte[] b)
Write a byte array to both output streams.

Parameters: b an array of bytes.

Throws: IOException on error.

write

public void write(byte[] b, int off, int len)
Write a byte array to both output streams.

Parameters: b the data. off the start offset in the data. len the number of bytes to write.

Throws: IOException on error.

write

public void write(int b)
Write a byte to both output streams.

Parameters: b the byte to write.

Throws: IOException on error.

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.