net.i2p.data.i2cp

## Class ReceiveMessageEndMessage

- java.lang.Object
- - net.i2p.data.i2cp.I2CPMessageImpl
  - - net.i2p.data.i2cp.ReceiveMessageEndMessage

- All Implemented Interfaces:
    I2CPMessage

      public class ReceiveMessageEndMessage
      extends I2CPMessageImpl

  Defines the message a client sends to a router when asking the router to start sending a message to it.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MESSAGE_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReceiveMessageEndMessage()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doReadMessage(InputStream in, int size)` Read in the payload part of the message (after the initial 4 byte size and 1 byte type)
    `protected byte[]` | `doWriteMessage()` Write out the payload part of the message (not including the 4 byte size and 1 byte type)
    `long` | `getMessageId()`
    `long` | `getSessionId()`
    `int` | `getType()` Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessages
    `SessionId` | `sessionId()` Return the SessionId for this message.
    `void` | `setMessageId(long id)`
    `void` | `setSessionId(long id)` Sets the session ID for this message.
    `String` | `toString()`

    - ### Methods inherited from class net.i2p.data.i2cp.I2CPMessageImpl

      `readBytes, readMessage, readMessage, writeBytes, writeMessage`

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

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

- - ### Field Detail

    - #### MESSAGE_TYPE

          public static final int MESSAGE_TYPE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ReceiveMessageEndMessage

          public ReceiveMessageEndMessage()

  - ### Method Detail

    - #### doReadMessage

          protected void doReadMessage(InputStream in,
                                       int size)
                                throws I2CPMessageException,
                                       IOException

      Description copied from class: `I2CPMessageImpl`
      Read in the payload part of the message (after the initial 4 byte size and 1 byte type)
      Specified by:
        `doReadMessage` in class `I2CPMessageImpl`
      Parameters:
        `in` - InputStream
        `size` - payload size
      Throws:
        `I2CPMessageException` - if the message format is invalid
        `IOException` - if there's an error reading from the stream

    - #### doWriteMessage

          protected byte[] doWriteMessage()
                                   throws I2CPMessageException,
                                          IOException

      Description copied from class: `I2CPMessageImpl`
      Write out the payload part of the message (not including the 4 byte size and 1 byte type)
      Specified by:
        `doWriteMessage` in class `I2CPMessageImpl`
      Returns:
        byte array
      Throws:
        `I2CPMessageException` - if the message cannot be written
        `IOException` - if there's an error writing to the stream

    - #### getMessageId

          public long getMessageId()

    - #### getSessionId

          public long getSessionId()

    - #### getType

          public int getType()

      Description copied from interface: `I2CPMessage`
      Return the unique identifier for this type of message, as specified in the network specification document under #ClientAccessLayerMessages
      Returns:
        unique identifier for this type of message

    - #### sessionId

          public SessionId sessionId()

      Return the SessionId for this message.
      Specified by:
        `sessionId` in interface `I2CPMessage`
      Overrides:
        `sessionId` in class `I2CPMessageImpl`
      Returns:
        null always. Extending classes with a SessionId must override.

    - #### setMessageId

          public void setMessageId(long id)

    - #### setSessionId

          public void setSessionId(long id)

      Sets the session ID for this message.
      Parameters:
        `id` - 0-65535

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`