public abstract class TunnelBuildMessageBase extends I2NPMessageImpl
I2NPMessageImpl.Builder| Modifier and Type | Field and Description |
|---|---|
protected EncryptedBuildRecord[] |
_records |
static int |
MAX_RECORD_COUNT |
protected int |
RECORD_COUNT |
static int |
RECORD_SIZE |
_context, _expiration, _log, CHECKSUM_LENGTH, DEFAULT_EXPIRATION_MS, HEADER_LENGTHMAX_ID_VALUE, MAX_SIZE| Modifier | Constructor and Description |
|---|---|
|
TunnelBuildMessageBase(I2PAppContext context) |
protected |
TunnelBuildMessageBase(I2PAppContext context,
int records) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateWrittenLength()
calculate the message body's length (not including the header and footer
|
EncryptedBuildRecord |
getRecord(int index) |
int |
getRecordCount() |
void |
readMessage(byte[] data,
int offset,
int dataSize,
int type)
Read the body into the data structures, after the initial type byte and
the uniqueId / expiration, using the current class's format as defined by
the I2NP specification
|
void |
setRecord(int index,
EncryptedBuildRecord record) |
protected int |
writeMessageBody(byte[] out,
int curIndex)
write the message body to the output array, starting at the given index.
|
createMessage, fromRawByteArray, fromRawByteArrayNTCP2, getMessageExpiration, getMessageSize, getRawMessageSize, getUniqueId, getUniqueId, readBytes, readBytes, readMessage, setMessageExpiration, setUniqueId, toByteArray, toByteArray, toByteArray, toRawByteArray, toRawByteArrayNTCP2clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTypeprotected EncryptedBuildRecord[] _records
public static final int MAX_RECORD_COUNT
protected int RECORD_COUNT
public static final int RECORD_SIZE
public TunnelBuildMessageBase(I2PAppContext context)
protected TunnelBuildMessageBase(I2PAppContext context, int records)
protected int calculateWrittenLength()
I2NPMessageImplcalculateWrittenLength in class I2NPMessageImplpublic EncryptedBuildRecord getRecord(int index)
public int getRecordCount()
public void readMessage(byte[] data,
int offset,
int dataSize,
int type)
throws I2NPMessageException
I2NPMessagedata - data to read fromoffset - where to start in the data arraydataSize - how long into the data to readtype - I2NP message typeI2NPMessageException - if the stream doesn't contain a valid message
that this class can read.public void setRecord(int index,
EncryptedBuildRecord record)
record - may be nullprotected int writeMessageBody(byte[] out,
int curIndex)
throws I2NPMessageException
I2NPMessageImplwriteMessageBody in class I2NPMessageImplI2NPMessageException