public class Command
extends Object
Storage
) or from scratch; its content can be read or written to a
Storage
.Constructor and Description |
---|
Command(int id)
Creates a command with a given identifier and an empty content.
|
Command(Storage rawStorage)
Builds a command from a
Storage received from the other endpoint. |
Modifier and Type | Method and Description |
---|---|
Storage |
content()
Returns the content.
|
int |
id()
Returns the type identifier.
|
int |
rawSize()
Returns the expected size of the serialized form of this command.
|
void |
writeRawTo(Storage out)
Writes the serialized form of this command to the given
Storage
object. |
public Command(Storage rawStorage)
Storage
received from the other endpoint.
Note that this will advance the storage's internal pointer to the next data.
rawStorage
- raw storagepublic Command(int id)
id
- idpublic int id()
public Storage content()
public void writeRawTo(Storage out)
Storage
object.
Note: this will advance the internal pointer of the given storage.
out
- outputpublic int rawSize()