public class MessagePayloadMessage extends I2CPMessageImpl
| Modifier and Type | Field and Description |
|---|---|
static int |
MESSAGE_TYPE |
| Constructor and Description |
|---|
MessagePayloadMessage()
For reading.
|
MessagePayloadMessage(long sessID,
long msgID,
Payload payload)
For writing
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doReadMessage(InputStream in,
int size)
Read in the payload part of the message (after the initial 4 byte size and 1
byte type)
|
protected byte[] |
doWriteMessage()
Write out the payload part of the message (not including the 4 byte size and
1 byte type)
|
long |
getMessageId() |
Payload |
getPayload() |
long |
getSessionId() |
int |
getType()
Return the unique identifier for this type of message, as specified in the
network specification document under #ClientAccessLayerMessages
|
SessionId |
sessionId()
Return the SessionId for this message.
|
String |
toString() |
void |
writeMessage(OutputStream out)
Write out the full message to the stream, including the 4 byte size and 1
byte type header.
|
readBytes, readMessage, readMessage, writeBytespublic static final int MESSAGE_TYPE
public MessagePayloadMessage()
public MessagePayloadMessage(long sessID,
long msgID,
Payload payload)
protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException
I2CPMessageImpldoReadMessage in class I2CPMessageImplin - InputStreamsize - payload sizeI2CPMessageException - if the message format is invalidIOException - if there's an error reading from the streamprotected byte[] doWriteMessage()
throws I2CPMessageException,
IOException
I2CPMessageImpldoWriteMessage in class I2CPMessageImplUnsupportedOperationException - alwaysI2CPMessageException - if the message cannot be writtenIOException - if there's an error writing to the streampublic long getMessageId()
public Payload getPayload()
public long getSessionId()
public int getType()
I2CPMessagepublic SessionId sessionId()
sessionId in interface I2CPMessagesessionId in class I2CPMessageImplpublic void writeMessage(OutputStream out) throws I2CPMessageException, IOException
writeMessage in interface I2CPMessagewriteMessage in class I2CPMessageImplout - OutputStreamIOException - if there's an error writing to the streamI2CPMessageException - if the current object doesn't have sufficient data
to write a properly formatted message.