public class RequestMessage
extends Object
Commands from the client to
server (i.e. requests). After construction, the commands are appended one
after one with append(Command). The whole message, along with its
length header, can be then retrieved in a serialized form via the
writeTo(DataOutputStream) method.| Constructor and Description |
|---|
RequestMessage() |
| Modifier and Type | Method and Description |
|---|---|
void |
append(Command c)
Adds a command to the tail of this message.
|
java.util.List<Command> |
commands() |
void |
writeTo(java.io.DataOutputStream dos)
Writes the commands to the specified
DataOutputStream object, in
the same order as the calls of append(Command). |
public void append(Command c)
c - cNullPointerException - if the command is null.public void writeTo(java.io.DataOutputStream dos)
throws java.io.IOException
DataOutputStream object, in
the same order as the calls of append(Command).dos - data output streamjava.io.IOException - Exceptionpublic java.util.List<Command> commands()