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 booleanaddOutputStream(OutputStream listenerStream)Add a output stream to also recieve everything this stream recievesvoidclearOutputStreams()Clears all connected output streamsvoidclose()voidflush()booleanremoveOutputStream(OutputStream listenerStream)Remove a output stream from recieving everything this stream recievesvoidwrite(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:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public void write(int arg0) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
-