## net.i2p.router.transport.udp
Class UDPPacketReader

    java.lang.Object
      net.i2p.router.transport.udp.UDPPacketReader

     class UDPPacketReader

extends Object

To read a packet, initialize this reader with the data and fetch out the appropriate fields. If the interesting bits are in message specific elements, grab the appropriate subreader.

Nested Class Summary
`class` `UDPPacketReader.DataReader` parse out the data message
`class` `UDPPacketReader.PeerTestReader` Help read the PeerTest payload
`class` `UDPPacketReader.RelayIntroReader` Help read the RelayIntro payload
`class` `UDPPacketReader.RelayRequestReader` Help read the RelayRequest payload
`class` `UDPPacketReader.RelayResponseReader` Help read the RelayResponse payload
`class` `UDPPacketReader.SessionConfirmedReader` parse out the confirmed message
`class` `UDPPacketReader.SessionCreatedReader` Help read the SessionCreated payload
`class` `UDPPacketReader.SessionRequestReader` Help read the SessionRequest payload

Constructor Summary
`UDPPacketReader(I2PAppContext ctx)`

Method Summary
`UDPPacketReader.DataReader` `getDataReader()`
`UDPPacketReader.PeerTestReader` `getPeerTestReader()`
`UDPPacketReader.RelayIntroReader` `getRelayIntroReader()`
`UDPPacketReader.RelayRequestReader` `getRelayRequestReader()`
`UDPPacketReader.RelayResponseReader` `getRelayResponseReader()`
`UDPPacketReader.SessionConfirmedReader` `getSessionConfirmedReader()`
`UDPPacketReader.SessionCreatedReader` `getSessionCreatedReader()`
`UDPPacketReader.SessionRequestReader` `getSessionRequestReader()`
`void` `initialize(byte[] message, int payloadOffset, int payloadLength)`
`void` `initialize(UDPPacket packet)`
`boolean` `readExtendedOptionsIncluded()`
`void` `readKeyingMaterial(byte[] target, int targetOffset)`
`int` `readPayloadType()` what type of payload is in here?
`boolean` `readRekeying()` does this packet include rekeying data?
`long` `readTimestamp()`
`void` `toRawString(StringBuilder buf)`
`String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### UDPPacketReader

    public UDPPacketReader(I2PAppContext ctx)

Method Detail

### initialize

    public void initialize(UDPPacket packet)

### initialize

    public void initialize(byte[] message,
                           int payloadOffset,
                           int payloadLength)

### readPayloadType

    public int readPayloadType()

  what type of payload is in here?

### readRekeying

    public boolean readRekeying()

  does this packet include rekeying data?

### readExtendedOptionsIncluded

    public boolean readExtendedOptionsIncluded()

### readTimestamp

    public long readTimestamp()

  Returns:
    seconds

### readKeyingMaterial

    public void readKeyingMaterial(byte[] target,
                                   int targetOffset)

### getSessionRequestReader

    public UDPPacketReader.SessionRequestReader getSessionRequestReader()

### getSessionCreatedReader

    public UDPPacketReader.SessionCreatedReader getSessionCreatedReader()

### getSessionConfirmedReader

    public UDPPacketReader.SessionConfirmedReader getSessionConfirmedReader()

### getDataReader

    public UDPPacketReader.DataReader getDataReader()

### getPeerTestReader

    public UDPPacketReader.PeerTestReader getPeerTestReader()

### getRelayRequestReader

    public UDPPacketReader.RelayRequestReader getRelayRequestReader()

### getRelayIntroReader

    public UDPPacketReader.RelayIntroReader getRelayIntroReader()

### getRelayResponseReader

    public UDPPacketReader.RelayResponseReader getRelayResponseReader()

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### toRawString

    public void toRawString(StringBuilder buf)