Class MultiSink<S extends Sink>

java.lang.Object
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 based on the toPort
Author:
zzz modded from streamr/MultiSource
  • Constructor Details

    • MultiSink

      public MultiSink(Map<Integer,S> cache)
      Parameters:
      cache - map of toPort to Sink
  • Method Details

    • 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, int fromPort, int toPort, byte[] data)
      Send to a single sink looked up by toPort May throw RuntimeException from underlying sinks
      Specified by:
      send in interface Sink
      Parameters:
      from - passed along
      fromPort - passed along
      toPort - passed along
      Throws:
      RuntimeException
      Since:
      0.9.53 added fromPort and toPort parameters