java.lang.Object
net.i2p.router.transport.udp.SSU2Payload.Block
net.i2p.router.transport.udp.SSU2Payload.FollowFragBlock
- Enclosing class:
SSU2Payload
Follow-on fragment block for SSU2 payload.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intFlag bits of the block.private OutboundMessageStateThe message state being tracked, if any.Constructor Summary
ConstructorsConstructorDescriptionFollowFragBlock(OutboundMessageState msg, int frag) Create a follow-on fragment block.Method Summary
Public MethodsModifier and TypeMethodDescriptionintReturn the fragment data length including the 5 byte header.(package private) voidsetMessage(OutboundMessageState msg, int frag) Repurpose this block for a new fragment.intwriteData(byte[] tgt, int off) Write the follow-on fragment 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.f
private int fFlag bits of the block.
Constructor Details
FollowFragBlock
Create a follow-on fragment block.- Parameters:
msg- the outbound message statefrag- the fragment number (must be > 0)
Method Details
setMessage
Repurpose this block for a new fragment. Only for pooling.- Parameters:
msg- the outbound message statefrag- the fragment number (must be > 0)
getDataLength
public int getDataLength()Return the fragment data length including the 5 byte header.- Specified by:
getDataLengthin classSSU2Payload.Block- Returns:
- the fragment data length
writeData
public int writeData(byte[] tgt, int off) Write the follow-on fragment 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