net.i2p.i2ptunnel.socks

## Class MultiSink<S extends Sink>

- java.lang.Object
- - net.i2p.i2ptunnel.socks.MultiSink<S>

- Type Parameters:
    `S` - type of Sink objects managed by this MultiSink
  All Implemented Interfaces:
    Sink, Source

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

  Sends to one of many Sinks based on toPort

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiSink(Map<Integer,S> cache)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
    `void` | `setSink(Sink sink)` Don't use this - put sinks in the cache
    `void` | `start()` Starts the source.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MultiSink

          public MultiSink(Map<Integer,S> cache)

      Parameters:
        `cache` - map of toPort to Sink

  - ### Method Detail

    - #### 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`

    - #### setSink

          public void setSink(Sink sink)

      Don't use this - put sinks in the cache
      Specified by:
        `setSink` in interface `Source`
      Parameters:
        `sink` - the sink to receive data

    - #### start

          public void start()

      Description copied from interface: `Source`
      Starts the source.
      Specified by:
        `start` in interface `Source`