java.lang.Object
net.i2p.router.transport.ntcp.NTCP2Payload.Block
net.i2p.router.transport.ntcp.NTCP2Payload.I2NPBlock
- Enclosing class:
NTCP2Payload
Block containing I2NP message.
Field Summary
FieldsConstructor Summary
ConstructorsMethod Summary
Public MethodsModifier and TypeMethodDescriptionintThe data length of this block.(package private) voidsetMessage(I2NPMessage msg) Set the message, for reuse of a pooled block.intwriteData(byte[] tgt, int off) Write the block data to the target array.Methods inherited from class NTCP2Payload.Block
getTotalLength, toString, write
Field Details
m
The message carried in the block.
Constructor Details
I2NPBlock
I2NPBlock.- Parameters:
msg- the message to write, whose size less 7 bytes becomes the block data
Method Details
setMessage
Set the message, for reuse of a pooled block.- Parameters:
msg- the message to write in place of the current one
getDataLength
public int getDataLength()The data length of this block.- Specified by:
getDataLengthin classNTCP2Payload.Block- Returns:
- the data length
writeData
public int writeData(byte[] tgt, int off) Write the block data to the target array.- Specified by:
writeDatain classNTCP2Payload.Block- Parameters:
tgt- the destination arrayoff- index in tgt to write the data at, past the 3-byte header- Returns:
- the offset just past the written data