|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.opends.server.util.MultiOutputStream
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class MultiOutputStream
This class defines a simple OutputStream
object that can be used to
write all messages to multiple targets at the same time, much like the UNIX
"tee" command. Note that this class will never throw any exceptions
Constructor Summary | |
---|---|
MultiOutputStream(java.io.OutputStream... targetStreams)
Creates a new MultiOutputStream object that will write all messages
to all of the target streams. |
Method Summary | |
---|---|
void |
close()
Closes all of the underlying output streams. |
void |
flush()
Flushes all of the underlying output streams. |
void |
write(byte[] b)
Writes the contents of the provided byte array to all of the underlying output streams. |
void |
write(byte[] b,
int off,
int len)
Writes the specified portion of the provided byte array to all of the underlying output streams. |
void |
write(int b)
Writes the specified byte to the set of target output streams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiOutputStream(java.io.OutputStream... targetStreams)
MultiOutputStream
object that will write all messages
to all of the target streams.
targetStreams
- The set of print streams to which all messages
should be written. This must not be null
,
nor may it contain any null
elements.Method Detail |
---|
public void close()
close
in interface java.io.Closeable
close
in class java.io.OutputStream
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
public void write(byte[] b)
write
in class java.io.OutputStream
b
- The byte array containing the data to be written.public void write(byte[] b, int off, int len)
write
in class java.io.OutputStream
b
- The byte array containing the data to be written.off
- The position at which the data to write begins in the array.len
- The number of bytes to b written.public void write(int b)
write
in class java.io.OutputStream
b
- The byte to be written.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |