net.i2p.i2ptunnel.udp

## Class I2PSinkAnywhere

- java.lang.Object
- - net.i2p.i2ptunnel.udp.I2PSinkAnywhere

- All Implemented Interfaces:
    Sink

      public class I2PSinkAnywhere
      extends Object
      implements Sink

  Producer This sends to any destination specified in send()

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected I2PDatagramMaker` | `maker`
    `protected boolean` | `raw`
    `protected I2PSession` | `sess`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `I2PSinkAnywhere(I2PSession sess)`
    `I2PSinkAnywhere(I2PSession sess, boolean raw)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `send(Destination to, byte[] data)`
    `void` | `send(Destination to, int fromPort, int toPort, byte[] data)`

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

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

- - ### Field Detail

    - #### maker

          protected final I2PDatagramMaker maker

    - #### raw

          protected final boolean raw

    - #### sess

          protected final I2PSession sess

  - ### Constructor Detail

    - #### I2PSinkAnywhere

          public I2PSinkAnywhere(I2PSession sess)

    - #### I2PSinkAnywhere

          public I2PSinkAnywhere(I2PSession sess,
                                 boolean raw)

  - ### Method Detail

    - #### send

          public void send(Destination to,
                           byte[] data)

      Parameters:
        `to` - - where it's going
      Throws:
        `RuntimeException` - if session is closed

    - #### send

          public void send(Destination to,
                           int fromPort,
                           int toPort,
                           byte[] data)

      Specified by:
        `send` in interface `Sink`
      Parameters:
        `to` - - where it's going
        `fromPort` - I2CP port 0 - 65535
        `toPort` - I2CP port 0 - 65535
      Throws:
        `RuntimeException` - if session is closed