public interface I2CPMessage extends DataStructure
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.
|
calculateHash, fromBase64, fromByteArray, readBytes, toBase64, toByteArray, writeBytes
void 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 streamvoid 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 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 streamint getType()
SessionId sessionId()