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

public static class SSU2Payload.FollowFragBlockextends SSU2Payload.Block
Follow-on fragment block for SSU2 payload.
  • Field Details

    • m

      The message state being tracked, if any.
    • f

      private int f
      Flag bits of the block.
  • Constructor Details

    • FollowFragBlock

      public FollowFragBlock(OutboundMessageState msg, int frag)
      Create a follow-on fragment block.
      Parameters:
      msg - the outbound message state
      frag - the fragment number (must be > 0)
  • Method Details

    • setMessage

      void setMessage(OutboundMessageState msg, int frag)
      Repurpose this block for a new fragment. Only for pooling.
      Parameters:
      msg - the outbound message state
      frag - the fragment number (must be > 0)
    • getDataLength

      public int getDataLength()
      Return the fragment data length including the 5 byte header.
      Specified by:
      getDataLength in class SSU2Payload.Block
      Returns:
      the fragment data length
    • writeData

      public int writeData(byte[] tgt, int off)
      Write the follow-on fragment 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