java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.I2NPBlock
Enclosing class:
SSU2Payload

public static class SSU2Payload.I2NPBlockextends SSU2Payload.Block
Block containing I2NP message data. Used to transport I2NP messages over SSU2.
  • Field Details

  • Constructor Details

    • I2NPBlock

      public I2NPBlock(OutboundMessageState msg)
      Create an I2NP message block.
      Parameters:
      msg - the outbound message state containing the I2NP message
  • Method Details

    • setMessage

      void setMessage(OutboundMessageState msg)
      Repurpose this block for a new message. Only for pooling.
      Parameters:
      msg - the outbound message state
    • getDataLength

      public int getDataLength()
      Return the full I2NP message size (9 byte header vs. 16).
      Specified by:
      getDataLength in class SSU2Payload.Block
      Returns:
      the message size
    • writeData

      public int writeData(byte[] tgt, int off)
      Write the I2NP block data to the target array.
      Specified by:
      writeData in class SSU2Payload.Block
      Parameters:
      tgt - target array to write to
      off - offset in the target array
      Returns:
      the new offset after writing