net.i2p.data.i2np
public class I2NPMessageHandler extends Object
Constructor and Description |
---|
I2NPMessageHandler(I2PAppContext context) |
Modifier and Type | Method and Description |
---|---|
long |
getLastReadTime() |
int |
getLastSize() |
I2NPMessage |
lastRead()
clear the last message read from a byte array with an offset
|
static void |
main(String[] args) |
I2NPMessage |
readMessage(byte[] data)
Read an I2NPMessage from the stream and return the fully populated object.
|
int |
readMessage(byte[] data,
int offset) |
I2NPMessage |
readMessage(InputStream in)
Read an I2NPMessage from the stream and return the fully populated object.
|
public I2NPMessageHandler(I2PAppContext context)
public I2NPMessage readMessage(InputStream in) throws IOException, I2NPMessageException
IOException
- if there is an IO problem reading from the streamI2NPMessageException
- if there is a problem handling the particular
message - if it is an unknown type or has improper formatting, etc.public I2NPMessage lastRead()
public I2NPMessage readMessage(byte[] data) throws IOException, I2NPMessageException
IOException
- if there is an IO problem reading from the streamI2NPMessageException
- if there is a problem handling the particular
message - if it is an unknown type or has improper formatting, etc.public int readMessage(byte[] data, int offset) throws IOException, I2NPMessageException
IOException
I2NPMessageException
public long getLastReadTime()
public int getLastSize()
public static void main(String[] args)