Class OutputStreamMultiplier
- java.lang.Object
-
- java.io.OutputStream
-
- de.unistuttgart.informatik.fius.icge.log.OutputStreamMultiplier
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class OutputStreamMultiplier extends OutputStream
A Output stream that allows multiple other output streams to attach themselves to this one.- Version:
- 1.0
- Author:
- Tobias Wältken
-
-
Constructor Summary
Constructors Constructor Description OutputStreamMultiplier()
Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addOutputStream(OutputStream listenerStream)
Add a output stream to also recieve everything this stream recievesvoid
clearOutputStreams()
Clears all connected output streamsvoid
close()
void
flush()
boolean
removeOutputStream(OutputStream listenerStream)
Remove a output stream from recieving everything this stream recievesvoid
write(int arg0)
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
-
-
-
Method Detail
-
addOutputStream
public boolean addOutputStream(OutputStream listenerStream)
Add a output stream to also recieve everything this stream recieves- Parameters:
listenerStream
- The stream to add- Returns:
- Returns True if successfull
-
removeOutputStream
public boolean removeOutputStream(OutputStream listenerStream)
Remove a output stream from recieving everything this stream recieves- Parameters:
listenerStream
- The stream to remove- Returns:
- Returns True if successfull
-
clearOutputStreams
public void clearOutputStreams()
Clears all connected output streams
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
public void write(int arg0) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
-