public abstract class TCPMessage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TCPMessage.Flag
TCP-based message flags.
|
static class |
TCPMessage.Type
TCP-based message types.
|
static class |
TCPMessage.Version
TCP-based message protocol version.
|
Modifier | Constructor and Description |
---|---|
protected |
TCPMessage()
Create a new
TCPMessage with a default version
of TCPMessage.Version.CMP2000 . |
protected |
TCPMessage(TCPMessage.Version version)
Create a new
TCPMessage with the given version. |
Modifier and Type | Method and Description |
---|---|
abstract TCPMessage.Type |
getType()
Get the TCP-based message type.
|
TCPMessage.Version |
getVersion()
Get the TCP-based message protocol version.
|
boolean |
hasFlag(TCPMessage.Flag flag)
Test whether or not the given message flag is set.
|
void |
input(java.io.InputStream is)
Reads this
TCPMessage 's encoding from the given
input stream. |
static TCPMessage |
inputInstance(java.io.InputStream is)
Creates a new instance of one of the
TCPMessage
subclasses by reading its encoding from the given input stream. |
int |
length() |
void |
output(java.io.OutputStream os)
Writes this
TCPMessage 's encoding to the given
output stream. |
void |
setFlag(TCPMessage.Flag flag)
Set the given message flag.
|
protected TCPMessage()
TCPMessage
with a default version
of TCPMessage.Version.CMP2000
.protected TCPMessage(TCPMessage.Version version)
TCPMessage
with the given version.public TCPMessage.Version getVersion()
public abstract TCPMessage.Type getType()
public void setFlag(TCPMessage.Flag flag)
public boolean hasFlag(TCPMessage.Flag flag)
public static TCPMessage inputInstance(java.io.InputStream is) throws java.io.IOException
TCPMessage
subclasses by reading its encoding from the given input stream.java.io.IOException
public void input(java.io.InputStream is) throws java.io.IOException
TCPMessage
's encoding from the given
input stream.
Should not be overridden by subclasses.
java.io.IOException
public void output(java.io.OutputStream os) throws java.io.IOException
TCPMessage
's encoding to the given
output stream.
Should not be overridden by subclasses.
java.io.IOException
public int length()