Package net.i2p.router.crypto.ratchet
Class RatchetPayload.Block
java.lang.Object
net.i2p.router.crypto.ratchet.RatchetPayload.Block
- Direct Known Subclasses:
RatchetPayload.AckBlock
,RatchetPayload.AckRequestBlock
,RatchetPayload.DateTimeBlock
,RatchetPayload.GarlicBlock
,RatchetPayload.NextKeyBlock
,RatchetPayload.OptionsBlock
,RatchetPayload.PaddingBlock
,RatchetPayload.PNBlock
,RatchetPayload.TerminationBlock
- Enclosing class:
- RatchetPayload
public abstract static class RatchetPayload.Block extends Object
Base class for blocks to be transmitted.
Not used for receive; we use callbacks instead.
-
Constructor Summary
Constructors Constructor Description Block(int ttype)
-
Method Summary
Modifier and Type Method Description abstract int
getDataLength()
int
getTotalLength()
String
toString()
int
write(byte[] tgt, int off)
abstract int
writeData(byte[] tgt, int off)
-
Constructor Details
-
Block
public Block(int ttype)
-
-
Method Details
-
write
public int write(byte[] tgt, int off)- Returns:
- new offset
-
getTotalLength
public int getTotalLength()- Returns:
- the size of the block, including the 3 byte header (type and size)
-
getDataLength
public abstract int getDataLength()- Returns:
- the size of the block, NOT including the 3 byte header (type and size)
-
writeData
public abstract int writeData(byte[] tgt, int off)- Returns:
- new offset
-
toString
-