uk.org.redfelineninja.net
Class MulticastWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--uk.org.redfelineninja.net.MulticastWriter

public class MulticastWriter
extends java.io.Writer

Tool for broadcasting actions performed on groups of writers.


Constructor Summary
MulticastWriter()
          Create a new MutlicastWriter with no listeners attached.
 
Method Summary
 void addListener(java.io.Writer w)
          Add a new listener to this multicaster.
 void close()
          Close the stream of all listeners, flushing them first.
 void flush()
          Flush the stream of all listeners.
 void removeListener(java.io.Writer w)
          Remove listener from this multicaster.
 void write(char[] cbuf, int off, int len)
          Write a portion of an array of characters to all listeners.
 
Methods inherited from class java.io.Writer
write, write, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MulticastWriter

public MulticastWriter()
Create a new MutlicastWriter with no listeners attached.

Method Detail

addListener

public void addListener(java.io.Writer w)
Add a new listener to this multicaster. The listener must be a writer.


removeListener

public void removeListener(java.io.Writer w)
Remove listener from this multicaster. The listener must be a writer.


write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
Write a portion of an array of characters to all listeners.

Specified by:
write in class java.io.Writer
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flush the stream of all listeners.

Specified by:
flush in class java.io.Writer
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the stream of all listeners, flushing them first.

Specified by:
close in class java.io.Writer
java.io.IOException