public interface I2CPMessage| Modifier and Type | Method and Description |
|---|---|
int | getType()Return the unique identifier for this type of message, as specified in the
network specification document under #ClientAccessLayerMessages |
void | readMessage(InputStream in)Read the contents from the input stream into the current class's format. |
void | readMessage(InputStream in,
int size,
int type)Read the contents from the input stream into the current class's format. |
SessionId | sessionId()Return the SessionId for this type of message. |
void | writeMessage(OutputStream out)Write the current message to the output stream as a full message following
the specification from the I2CP definition. |
int getType()
void readMessage(InputStream in) throws I2CPMessageException, IOException
in - stream to read fromI2CPMessageException - if the stream doesn't contain a valid message
that this class can read.IOException - if there is a problem reading from the streamvoid readMessage(InputStream in, int size, int type) throws I2CPMessageException, IOException
in - stream to read fromsize - number of bytes in the message payloadtype - type of message (should equal getType())I2CPMessageException - if the stream doesn't contain a valid message
that this class can read.IOException - if there is a problem reading from the streamSessionId sessionId()
void writeMessage(OutputStream out) throws I2CPMessageException, IOException
out - OutputStreamI2CPMessageException - if the current object doesn't have sufficient data
to write a properly formatted message.IOException - if there is a problem writing to the stream