net.i2p.i2ptunnel.socks
Class MultiSink<S extends Sink>

java.lang.Object
  extended by net.i2p.i2ptunnel.socks.MultiSink<S>
All Implemented Interfaces:
Sink, Source

public class MultiSink<S extends Sink>
extends Object
implements Source, Sink

Sends to one of many Sinks

Author:
zzz modded from streamr/MultiSource

Constructor Summary
MultiSink(Map<Destination,S> cache)
           
 
Method Summary
 void send(Destination from, byte[] data)
          May throw RuntimeException from underlying sinks
 void setSink(Sink sink)
          Don't use this - put sinks in the cache
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiSink

public MultiSink(Map<Destination,S> cache)
Method Detail

setSink

public void setSink(Sink sink)
Don't use this - put sinks in the cache

Specified by:
setSink in interface Source

start

public void start()
Specified by:
start in interface Source

send

public void send(Destination from,
                 byte[] data)
May throw RuntimeException from underlying sinks

Specified by:
send in interface Sink
Parameters:
from - some implementations may ignore
Throws:
RuntimeException