class RatchetPayload extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RatchetPayload.Block
Base class for blocks to be transmitted.
|
static class |
RatchetPayload.DateTimeBlock |
static class |
RatchetPayload.GarlicBlock |
static class |
RatchetPayload.NextKeyBlock |
static class |
RatchetPayload.OptionsBlock |
static class |
RatchetPayload.PaddingBlock |
static interface |
RatchetPayload.PayloadCallback
For all callbacks, recommend throwing exceptions only from the handshake.
|
static class |
RatchetPayload.TerminationBlock |
Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_HEADER_SIZE |
Constructor and Description |
---|
RatchetPayload() |
Modifier and Type | Method and Description |
---|---|
(package private) static long |
fromLong8(byte[] src,
int offset)
Big endian.
|
static int |
processPayload(I2PAppContext ctx,
RatchetPayload.PayloadCallback cb,
byte[] payload,
int off,
int length,
boolean isHandshake)
Incoming payload.
|
(package private) static void |
toLong8(byte[] target,
int offset,
long value)
Big endian.
|
static int |
writePayload(byte[] payload,
int off,
List<RatchetPayload.Block> blocks) |
public static final int BLOCK_HEADER_SIZE
public static int processPayload(I2PAppContext ctx, RatchetPayload.PayloadCallback cb, byte[] payload, int off, int length, boolean isHandshake) throws IOException, DataFormatException, I2NPMessageException
IOException
- on major errorsDataFormatException
- on parsing of individual blocksI2NPMessageException
- on parsing of I2NP blockpublic static int writePayload(byte[] payload, int off, List<RatchetPayload.Block> blocks)
payload
- writes to it starting at offstatic long fromLong8(byte[] src, int offset)
ArrayIndexOutOfBoundsException
static void toLong8(byte[] target, int offset, long value)
ArrayIndexOutOfBoundsException