java.lang.Object
net.i2p.router.crypto.ratchet.RatchetPayload.Block
net.i2p.router.crypto.ratchet.RatchetPayload.GarlicBlock
Enclosing class:
RatchetPayload

public static class RatchetPayload.GarlicBlockextends RatchetPayload.Block
Garlic clove block for embedding I2NP messages in ratchet payload.
  • Field Details

    • c

      private GarlicClove c
      The clove carried in the garlic block.
  • Constructor Details

    • GarlicBlock

      public GarlicBlock(GarlicClove clove)
      The clove carried by this block.
      Parameters:
      clove - the garlic clove
  • Method Details

    • setClove

      void setClove(GarlicClove clove)
      Set the clove carried by this block, for reuse.
      Parameters:
      clove - the garlic clove
    • getDataLength

      public int getDataLength()
      Data length of the block.
      Specified by:
      getDataLength in class RatchetPayload.Block
      Returns:
      the size of the block, NOT including the 3 byte header (type and size)
    • writeData

      public int writeData(byte[] tgt, int off)
      Writes the block to the output buffer at the given offset.
      Specified by:
      writeData in class RatchetPayload.Block
      Parameters:
      tgt - the target buffer
      off - the offset in tgt where the block data starts
      Returns:
      the offset just past the data written to tgt