public interface IMessage
| Modifier and Type | Method and Description |
|---|---|
int |
getId()
The id of this message
|
int |
getLength()
The length of the message (only needed on writing)
The length should include the byte for the message id |
void |
process(Peer peer)
Process the message
|
void |
read(InStream inStream)
Read a message from the inputStream
|
void |
write(OutStream outStream)
Writes the message to the output stream
|
void write(OutStream outStream)
outStream - The buffered outputstream to write the message onvoid read(InStream inStream)
inStream - The buffered inputstream to read the message fromvoid process(Peer peer)
peer - The client which should process this messageint getLength()
int getId()
UnsupportedOperationException - Will be thrown when the message has no ID. For example: MessageKeepAlive.Copyright © 2016. All rights reserved.