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_LENGTH
MAX_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, readBytes, readMessage, registerBuilder, setMessageExpiration, setUniqueId, toByteArray, toByteArray, toByteArray, toRawByteArray, toRawByteArrayNTCP2, writeBytes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType
protected EncryptedBuildRecord[] _records
protected int RECORD_COUNT
public static final int MAX_RECORD_COUNT
public static final int RECORD_SIZE
public TunnelBuildMessageBase(I2PAppContext context)
protected TunnelBuildMessageBase(I2PAppContext context, int records)
public void setRecord(int index, EncryptedBuildRecord record)
record
- may be nullpublic EncryptedBuildRecord getRecord(int index)
public int getRecordCount()
protected int calculateWrittenLength()
I2NPMessageImpl
calculateWrittenLength
in class I2NPMessageImpl
public void readMessage(byte[] data, int offset, int dataSize, int type) throws I2NPMessageException
I2NPMessage
data
- 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.protected int writeMessageBody(byte[] out, int curIndex) throws I2NPMessageException
I2NPMessageImpl
writeMessageBody
in class I2NPMessageImpl
I2NPMessageException