Class EIEIOCommandMessage.Header
java.lang.Object
uk.ac.manchester.spinnaker.messages.eieio.EIEIOCommandMessage.Header
- All Implemented Interfaces:
EIEIOHeader
,SerializableMessage
- Enclosing class:
- EIEIOCommandMessage
EIEIO header for command packets.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHeader
(int command) Create a new command header.Header
(EIEIOCommand command) Create a new command header. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToBuffer
(ByteBuffer buffer) Writes this message into the given buffer as a contiguous range of bytes.
-
Field Details
-
command
The command ID in this header.
-
-
Constructor Details
-
Header
Create a new command header.- Parameters:
command
- The command.
-
Header
public Header(int command) Create a new command header.- Parameters:
command
- The encoded command.
-
-
Method Details
-
addToBuffer
Description copied from interface:SerializableMessage
Writes this message into the given buffer as a contiguous range of bytes. This is so that a message can be sent. Implementors may assume that the buffer has been configured to be little-endian and that its position is at the point where they should begin writing. Once it has finished, the position should be immediately after the last byte written by this method.Calling this method should not update the internal state of the message. It should be possible to add the message to multiple buffers without special precautions by the caller.
- Specified by:
addToBuffer
in interfaceSerializableMessage
- Parameters:
buffer
- The buffer to write into.
-