DataStructure
, I2CPMessage
BandwidthLimitsMessage
, CreateLeaseSetMessage
, CreateSessionMessage
, DestLookupMessage
, DestReplyMessage
, DestroySessionMessage
, DisconnectMessage
, GetBandwidthLimitsMessage
, GetDateMessage
, HostLookupMessage
, HostReplyMessage
, MessagePayloadMessage
, MessageStatusMessage
, PoisonI2CPMessage
, ReceiveMessageBeginMessage
, ReceiveMessageEndMessage
, ReconfigureSessionMessage
, ReportAbuseMessage
, RequestLeaseSetMessage
, RequestVariableLeaseSetMessage
, SendMessageMessage
, SessionStatusMessage
, SetDateMessage
public abstract class I2CPMessageImpl extends DataStructureImpl implements I2CPMessage
コンストラクタ | 説明 |
---|---|
I2CPMessageImpl() |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
protected abstract void |
doReadMessage(java.io.InputStream buf,
int size) |
Read in the payload part of the message (after the initial 4 byte size and 1
byte type)
|
protected abstract byte[] |
doWriteMessage() |
Write out the payload part of the message (not including the 4 byte size and
1 byte type)
|
void |
readBytes(java.io.InputStream in) |
Load up the current object with data from the given stream.
|
void |
readMessage(java.io.InputStream in) |
Validate the type and size of the message, and then read the message into the data structures.
|
void |
readMessage(java.io.InputStream in,
int length,
int type) |
Read the body into the data structures
|
SessionId |
sessionId() |
Return the SessionId for this type of message.
|
void |
writeBytes(java.io.OutputStream out) |
Write out the data structure to the stream, using the format defined in the
I2P data structure specification.
|
void |
writeMessage(java.io.OutputStream out) |
Write out the full message to the stream, including the 4 byte size and 1
byte type header.
|
calculateHash, fromBase64, fromByteArray, toBase64, toByteArray
calculateHash, fromBase64, fromByteArray, read, toBase64, toByteArray
getType
public void readMessage(java.io.InputStream in) throws I2CPMessageException, java.io.IOException
readMessage
インタフェース内 I2CPMessage
in
- stream to read fromjava.io.IOException
I2CPMessageException
- if the stream doesn't contain a valid message
that this class can read.public void readMessage(java.io.InputStream in, int length, int type) throws I2CPMessageException, java.io.IOException
readMessage
インタフェース内 I2CPMessage
length
- number of bytes in the message payloadin
- stream to read fromtype
- type of message (should equal getType())java.io.IOException
I2CPMessageException
- if the stream doesn't contain a valid message
that this class can read.protected abstract void doReadMessage(java.io.InputStream buf, int size) throws I2CPMessageException, java.io.IOException
buf
- InputStreamsize
- payload sizeI2CPMessageException
java.io.IOException
protected abstract byte[] doWriteMessage() throws I2CPMessageException, java.io.IOException
I2CPMessageException
java.io.IOException
public void writeMessage(java.io.OutputStream out) throws I2CPMessageException, java.io.IOException
writeMessage
インタフェース内 I2CPMessage
out
- OutputStreamjava.io.IOException
I2CPMessageException
- if the current object doesn't have sufficient data
to write a properly formatted message.public void readBytes(java.io.InputStream in) throws DataFormatException, java.io.IOException
DataStructure
readBytes
インタフェース内 DataStructure
in
- stream to read fromDataFormatException
- if the data is improperly formattedjava.io.IOException
- if there was a problem reading the streampublic void writeBytes(java.io.OutputStream out) throws DataFormatException, java.io.IOException
DataStructure
writeBytes
インタフェース内 DataStructure
out
- stream to write toDataFormatException
- if the data was incomplete or not yet ready to be writtenjava.io.IOException
- if there was a problem writing to the streampublic SessionId sessionId()
sessionId
インタフェース内 I2CPMessage