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

public static class SSU2Payload.DateTimeBlockextends SSU2Payload.Block
Block containing the current date and time. Used for time synchronization between peers.
  • Field Details

    • now

      private final long now
      The sender's current time.
  • Constructor Details

    • DateTimeBlock

      public DateTimeBlock(I2PAppContext ctx)
      Create a date/time block with the current clock time.
      Parameters:
      ctx - the I2P context for reading the clock
  • Method Details

    • getDataLength

      public int getDataLength()
      Return the 4 byte date/time data length.
      Specified by:
      getDataLength in class SSU2Payload.Block
      Returns:
      the data length
    • writeData

      public int writeData(byte[] tgt, int off)
      Write the date/time 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