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

public static class RatchetPayload.DateTimeBlockextends RatchetPayload.Block
Timestamp block for ratchet payload synchronization and timing.
  • Field Details

    • now

      private long now
      The date and time sent in the payload.
  • Constructor Details

    • DateTimeBlock

      public DateTimeBlock(long time)
      Timestamp carried by this block.
      Parameters:
      time - the expiry in ms since the epoch; divided by 1000 on the wire
  • Method Details

    • setTime

      void setTime(long time)
      Set the timestamp, for reuse.
      Parameters:
      time - the expiry in ms since the epoch; divided by 1000 on the wire
    • 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