public class I2NPMessageHandler
extends java.lang.Object
コンストラクタ | 説明 |
---|---|
I2NPMessageHandler(I2PAppContext context) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
long |
getLastReadTime() |
|
int |
getLastSize() |
|
I2NPMessage |
lastRead() |
clear the last message read from a byte array with an offset
|
I2NPMessage |
readMessage(byte[] data) |
Read an I2NPMessage from the byte array and return the fully populated object.
|
int |
readMessage(byte[] data,
int offset) |
Result is retreived with lastRead()
|
int |
readMessage(byte[] data,
int offset,
int maxLen) |
Set a limit on the max to read from the data buffer, so that
we can use a large buffer but prevent the reader from reading off the end.
|
I2NPMessage |
readMessage(java.io.InputStream in) |
推奨されていません。
use the byte array method to avoid an extra copy if you have it
|
public I2NPMessageHandler(I2PAppContext context)
@Deprecated public I2NPMessage readMessage(java.io.InputStream in) throws java.io.IOException, I2NPMessageException
I2NPMessageException
- if there is a problem handling the particular
message - if it is an unknown type or has improper formatting, etc.java.io.IOException
public I2NPMessage lastRead()
public I2NPMessage readMessage(byte[] data) throws I2NPMessageException
I2NPMessageException
- 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 I2NPMessageException
public int readMessage(byte[] data, int offset, int maxLen) throws I2NPMessageException
maxLen
- read no more than this many bytes from data starting at offset, even if it is longer
must be at least 16I2NPMessageException
public long getLastReadTime()
public int getLastSize()