java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.TerminationBlock
- Enclosing class:
SSU2Payload
Block containing session termination data. Used to signal session termination.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionTerminationBlock(int reason, long lastReceived) Create a session termination block.Method Summary
All MethodsModifier and TypeMethodDescriptionintReturn the 9 byte termination data length.intwriteData(byte[] tgt, int off) Write the termination block data to the target array.Methods inherited from class SSU2Payload.Block
getTotalLength, getType, toString, write
Field Details
rsn
private final byte rsnThe termination reason number.rcvd
private final long rcvdCount of messages received, if known.
Constructor Details
TerminationBlock
public TerminationBlock(int reason, long lastReceived) Create a session termination block.- Parameters:
reason- termination reason code (0-255)lastReceived- highest sequence number received
Method Details
getDataLength
public int getDataLength()Return the 9 byte termination data length.- Specified by:
getDataLengthin classSSU2Payload.Block- Returns:
- the data length
writeData
public int writeData(byte[] tgt, int off) Write the termination 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