java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.DateTimeBlock
- Enclosing class:
SSU2Payload
Block containing the current date and time. Used for time synchronization between peers.
Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionCreate a date/time block with the current clock time.Method Summary
All MethodsModifier and TypeMethodDescriptionintReturn the 4 byte date/time data length.intwriteData(byte[] tgt, int off) Write the date/time block data to the target array.Methods inherited from class SSU2Payload.Block
getTotalLength, getType, toString, write
Field Details
now
private final long nowThe sender's current time.
Constructor Details
DateTimeBlock
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:
getDataLengthin classSSU2Payload.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:
writeDatain classSSU2Payload.Block- Parameters:
tgt- target array to write tooff- offset in the target array- Returns:
- the new offset after writing