net.i2p.i2ptunnel.udp

## Class I2PSink

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

- All Implemented Interfaces:
    Sink

      public class I2PSink
      extends Object
      implements Sink

  Producer This sends to a fixed destination specified in the constructor

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `I2PSink(I2PSession sess, Destination dest)` repliable (not raw)
    `I2PSink(I2PSession sess, Destination dest, boolean raw)`
    `I2PSink(I2PSession sess, Destination dest, boolean raw, int toPort)`

  - ### Method Summary

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

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

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

- - ### Field Detail

    - #### dest

          protected final Destination dest

    - #### maker

          protected final I2PDatagramMaker maker

    - #### raw

          protected final boolean raw

    - #### sess

          protected final I2PSession sess

    - #### toPort

          protected final int toPort

  - ### Constructor Detail

    - #### I2PSink

          public I2PSink(I2PSession sess,
                         Destination dest)

      repliable (not raw)

    - #### I2PSink

          public I2PSink(I2PSession sess,
                         Destination dest,
                         boolean raw)

      Parameters:
        `raw` - false for repliable

    - #### I2PSink

          public I2PSink(I2PSession sess,
                         Destination dest,
                         boolean raw,
                         int toPort)

      Parameters:
        `raw` - false for repliable
        `toPort` - I2CP destination port, 0-65535

  - ### Method Detail

    - #### send

          public void send(Destination src,
                           int fromPort,
                           int ign_toPort,
                           byte[] data)

      Specified by:
        `send` in interface `Sink`
      Parameters:
        `src` - ignored
        `fromPort` - I2CP port
        `ign_toPort` - ignored
      Throws:
        `RuntimeException` - if session is closed