net.i2p.data.i2cp

## Class SessionId

- java.lang.Object
- - net.i2p.data.i2cp.SessionId

-     public class SessionId
      extends Object

  Defines the token passed between the router and client to associate messages with a particular session. These IDs are not globally unique. As of 0.9.48, does NOT extend DataStructureImpl.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionId()`
    `SessionId(int id)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `int` | `getSessionId()`
    `int` | `hashCode()`
    `void` | `readBytes(InputStream in)` Read the session ID from a stream.
    `void` | `setSessionId(int id)` Set the session ID.
    `String` | `toString()`
    `void` | `writeBytes(OutputStream out)`

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

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

- - ### Constructor Detail

    - #### SessionId

          public SessionId()

    - #### SessionId

          public SessionId(int id)

      Parameters:
        `id` - 0-65535

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getSessionId

          public int getSessionId()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### readBytes

          public void readBytes(InputStream in)
                         throws DataFormatException,
                                IOException

      Read the session ID from a stream.
      Throws:
        `IllegalStateException` - if already set
        `DataFormatException`
        `IOException`

    - #### setSessionId

          public void setSessionId(int id)

      Set the session ID.
      Parameters:
        `id` - 0-65535
      Throws:
        `IllegalArgumentException` - if the ID is out of range
        `IllegalStateException` - if already set

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### writeBytes

          public void writeBytes(OutputStream out)
                          throws DataFormatException,
                                 IOException

      Throws:
        `DataFormatException`
        `IOException`