Package net.i2p.data.i2np
Class VariableTunnelBuildMessage
java.lang.Object
net.i2p.data.i2np.I2NPMessageImpl
net.i2p.data.i2np.TunnelBuildMessageBase
net.i2p.data.i2np.TunnelBuildMessage
net.i2p.data.i2np.VariableTunnelBuildMessage
- All Implemented Interfaces:
- I2NPMessage
public class VariableTunnelBuildMessage extends TunnelBuildMessage
Variable number of records.
- Since:
- 0.7.12
- 
Nested Class SummaryNested classes/interfaces inherited from class net.i2p.data.i2np.I2NPMessageImplI2NPMessageImpl.Builder
- 
Field SummaryFields Modifier and Type Field Description static intMESSAGE_TYPEFields inherited from class net.i2p.data.i2np.TunnelBuildMessageBase_records, MAX_RECORD_COUNT, RECORD_COUNT, RECORD_SIZEFields inherited from class net.i2p.data.i2np.I2NPMessageImpl_context, _expiration, _log, CHECKSUM_LENGTH, DEFAULT_EXPIRATION_MS, HEADER_LENGTH
- 
Constructor SummaryConstructors Constructor Description VariableTunnelBuildMessage(I2PAppContext context)zero record count, will be set with readMessage()VariableTunnelBuildMessage(I2PAppContext context, int records)
- 
Method SummaryModifier and Type Method Description protected intcalculateWrittenLength()calculate the message body's length (not including the header and footerintgetType()Return the unique identifier for this type of I2NP message, as defined in the I2NP specvoidreadMessage(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 specificationStringtoString()protected intwriteMessageBody(byte[] out, int curIndex)write the message body to the output array, starting at the given index.Methods inherited from class net.i2p.data.i2np.TunnelBuildMessageBasegetRecord, getRecordCount, setRecordMethods inherited from class net.i2p.data.i2np.I2NPMessageImplcreateMessage, fromRawByteArray, fromRawByteArrayNTCP2, getMessageExpiration, getMessageSize, getRawMessageSize, getUniqueId, readBytes, readBytes, readBytes, readMessage, registerBuilder, setMessageExpiration, setUniqueId, toByteArray, toByteArray, toByteArray, toRawByteArray, toRawByteArrayNTCP2, writeBytes
- 
Field Details- 
MESSAGE_TYPEpublic static final int MESSAGE_TYPE- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
VariableTunnelBuildMessagezero record count, will be set with readMessage()
- 
VariableTunnelBuildMessage
 
- 
- 
Method Details- 
calculateWrittenLengthprotected int calculateWrittenLength()Description copied from class:I2NPMessageImplcalculate the message body's length (not including the header and footer- Overrides:
- calculateWrittenLengthin class- TunnelBuildMessageBase
 
- 
getTypepublic int getType()Description copied from interface:I2NPMessageReturn the unique identifier for this type of I2NP message, as defined in the I2NP spec- Specified by:
- getTypein interface- I2NPMessage
- Overrides:
- getTypein class- TunnelBuildMessage
 
- 
readMessagepublic void readMessage(byte[] data, int offset, int dataSize, int type) throws I2NPMessageExceptionDescription copied from interface:I2NPMessageRead 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- Specified by:
- readMessagein interface- I2NPMessage
- Overrides:
- readMessagein class- TunnelBuildMessageBase
- Parameters:
- data- data to read from
- offset- where to start in the data array
- dataSize- how long into the data to read
- type- I2NP message type
- Throws:
- I2NPMessageException- if the stream doesn't contain a valid message that this class can read.
 
- 
writeMessageBodyDescription copied from class:I2NPMessageImplwrite the message body to the output array, starting at the given index.- Overrides:
- writeMessageBodyin class- TunnelBuildMessageBase
- Returns:
- the index into the array after the last byte written (NOT the length)
- Throws:
- I2NPMessageException
 
- 
toString- Overrides:
- toStringin class- TunnelBuildMessage
 
 
-