|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Base interface for all I2NP messages
Field Summary | |
static long |
MAX_ID_VALUE
|
Method Summary | |
long |
getMessageExpiration()
Date after which the message should be dropped (and the associated uniqueId forgotten) |
int |
getMessageSize()
How large the message is, including any checksums |
int |
getType()
Return the unique identifier for this type of I2NP message, as defined in the I2NP spec |
long |
getUniqueId()
Replay resistent message Id |
int |
readBytes(byte[] data,
int type,
int offset)
|
int |
readBytes(java.io.InputStream in,
int type,
byte[] buffer)
Read the body into the data structures, after the initial type byte, using the current class's format as defined by the I2NP specification |
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 |
int |
toByteArray(byte[] buffer)
write the message to the buffer, returning the number of bytes written |
Methods inherited from interface net.i2p.data.DataStructure |
calculateHash, fromBase64, fromByteArray, readBytes, toBase64, toByteArray, writeBytes |
Field Detail |
public static final long MAX_ID_VALUE
Method Detail |
public int readBytes(java.io.InputStream in, int type, byte[] buffer) throws I2NPMessageException, java.io.IOException
in
- stream to read fromtype
- I2NP message typebuffer
- scratch buffer to be used when reading and parsing
I2NPMessageException
- if the stream doesn't contain a valid message
that this class can read.
java.io.IOException
- if there is a problem reading from the streampublic int readBytes(byte[] data, int type, int offset) throws I2NPMessageException, java.io.IOException
I2NPMessageException
java.io.IOException
public void readMessage(byte[] data, int offset, int dataSize, int type) throws I2NPMessageException, java.io.IOException
data
- data to read fromoffset
- where to start in the data arraydataSize
- how long into the data to readtype
- I2NP message type
I2NPMessageException
- if the stream doesn't contain a valid message
that this class can read.
java.io.IOException
- if there is a problem reading from the streampublic int getType()
public long getUniqueId()
public long getMessageExpiration()
public int getMessageSize()
public int toByteArray(byte[] buffer)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |