java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.I2NPBlock
- Enclosing class:
SSU2Payload
Block containing I2NP message data. Used to transport I2NP messages over SSU2.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate OutboundMessageStateThe message state being tracked, if any.Constructor Summary
ConstructorsMethod Summary
Public MethodsModifier and TypeMethodDescriptionintReturn the full I2NP message size (9 byte header vs.(package private) voidRepurpose this block for a new message.intwriteData(byte[] tgt, int off) Write the I2NP block data to the target array.Methods inherited from class SSU2Payload.Block
getTotalLength, getType, toString, write
Field Details
m
The message state being tracked, if any.
Constructor Details
I2NPBlock
Create an I2NP message block.- Parameters:
msg- the outbound message state containing the I2NP message
Method Details
setMessage
Repurpose this block for a new message. Only for pooling.- Parameters:
msg- the outbound message state
getDataLength
public int getDataLength()Return the full I2NP message size (9 byte header vs. 16).- Specified by:
getDataLengthin classSSU2Payload.Block- Returns:
- the message size
writeData
public int writeData(byte[] tgt, int off) Write the I2NP 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