de.unkrig.commons.net.stream
Class PassiveSocketOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.unkrig.commons.net.stream.PassiveSocketOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class PassiveSocketOutputStream
extends java.io.OutputStream

An OutputStream that accepts connections from remote clients and sends the data to all connected clients. This includes the case where no client is connected, and the data is thus silently discarded.


Constructor Summary
PassiveSocketOutputStream(java.net.InetSocketAddress localAddress)
           
PassiveSocketOutputStream(int port)
           
 
Method Summary
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassiveSocketOutputStream

public PassiveSocketOutputStream(int port)
                          throws java.io.IOException
Throws:
java.io.IOException

PassiveSocketOutputStream

public PassiveSocketOutputStream(java.net.InetSocketAddress localAddress)
                          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

write

public void write(int b)
Specified by:
write in class java.io.OutputStream

write

public void write(byte[] b,
                  int off,
                  int len)
Overrides:
write in class java.io.OutputStream