java.lang.Object
net.i2p.router.crypto.ratchet.RatchetPayload.Block
net.i2p.router.crypto.ratchet.RatchetPayload.AckBlock
- Enclosing class:
RatchetPayload
Acknowledgment block for ratchet payload.
Field Summary
FieldsConstructor Summary
Method Summary
Public MethodsModifier and TypeMethodDescriptionintData length of the block.(package private) voidSet the ACK data, for reuse.intwriteData(byte[] tgt, int off) Writes the block to the output buffer at the given offset.Methods inherited from class RatchetPayload.Block
getTotalLength, toString, write
Field Details
data
private byte[] dataThe message number bytes sent in the payload.
Constructor Details
AckBlock
public AckBlock(int keyID, int n) Builds an ACK block for a single key ID and count.- Parameters:
keyID- the ratchet key ID being acknowledgedn- the message count acknowledged for that key
AckBlock
Method Details
setAcks
getDataLength
public int getDataLength()Data length of the block.- Specified by:
getDataLengthin classRatchetPayload.Block- Returns:
- the size of the block, NOT including the 3 byte header (type and size)
writeData
public int writeData(byte[] tgt, int off) Writes the block to the output buffer at the given offset.- Specified by:
writeDatain classRatchetPayload.Block- Parameters:
tgt- the target bufferoff- the offset in tgt where the block data starts- Returns:
- the offset just past the data written to tgt