java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.PeerTestBlock
- Enclosing class:
SSU2Payload
Block containing peer test data. Used for network reachability testing.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionPeerTestBlock(int msgNum, int code, Hash hash, byte[] data) Wrap a peer test as a block.Method Summary
All MethodsModifier and TypeMethodDescriptionintThe data length of this block.intwriteData(byte[] tgt, int off) Write this block's data to the target array.Methods inherited from class SSU2Payload.Block
getTotalLength, getType, toString, write
Field Details
n
private final int nThe peer test nonce.c
private final int cThe peer test counter.h
The hash echoed in the test.d
private final byte[] dExtra data of the test.
Constructor Details
PeerTestBlock
Wrap a peer test as a block.- Parameters:
msgNum- the message number the test answerscode- the test result codehash- may be nulldata- the test payload bytes
Method Details
getDataLength
public int getDataLength()The data length of this block.- Specified by:
getDataLengthin classSSU2Payload.Block- Returns:
- the data length
writeData
public int writeData(byte[] tgt, int off) Write this block's 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