Package com.thecoderscorner.menu.remote
Interface MenuCommandProtocol
- All Known Implementing Classes:
TagValMenuCommandProtocol
public interface MenuCommandProtocol
This is a low level part of the API that most people don't need to deal, implementations will translate
commands to and from a given protocol.
-
Method Summary
Modifier and TypeMethodDescriptionfromChannel(ByteBuffer buffer) Retrieves a message from the channel, or throws an exception if the message is not fully formed.bytereturns the identifier for this protocol, when used in messagesvoidtoChannel(ByteBuffer buffer, MenuCommand cmd) Puts the command specified into the byte buffer, it is assumed that the callee will flip the channel once complete.
-
Method Details
-
fromChannel
Retrieves a message from the channel, or throws an exception if the message is not fully formed. It is assumed that the buffer has been suitably flipped ready for reading- Throws:
IOException
-
getKeyIdentifier
byte getKeyIdentifier()returns the identifier for this protocol, when used in messages- Returns:
- the ID for this protocol
-