java.lang.Object
net.i2p.data.i2cp.MessageId
Defines the message ID of a message delivered between a router and a client in a particular session. These IDs are not globally unique.
As of 0.9.48, does NOT extend DataStructureImpl.
Field Summary
FieldsConstructor Summary
Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanlongRead the wrapped message ID.inthashCode()voidreadBytes(InputStream in) Read the message ID from a stream.voidsetMessageId(long id) Set the message ID.toString()voidwriteBytes(OutputStream out) Write the message ID to a stream.
Field Details
_messageId
private long _messageIdThe message's 64-bit identifier.
Constructor Details
MessageId
public MessageId()Create an unset message ID, stored as -1.MessageId
public MessageId(long id) Create a message ID wrapping the given value.- Parameters:
id- the message ID
Method Details
getMessageId
public long getMessageId()Read the wrapped message ID.- Returns:
- the message ID
setMessageId
public void setMessageId(long id) Set the message ID.- Parameters:
id- the message ID
readBytes
Read the message ID from a stream.- Parameters:
in- the input stream to read from- Throws:
DataFormatException- if the data is invalidIOException- if there is an error reading
writeBytes
Write the message ID to a stream.- Parameters:
out- the output stream to write to- Throws:
DataFormatException- if the message ID is invalidIOException- if there is an error writing
equals
hashCode
toString