Class SDPMessage
java.lang.Object
uk.ac.manchester.spinnaker.messages.sdp.SpinnakerRequest
uk.ac.manchester.spinnaker.messages.sdp.SDPMessage
- All Implemented Interfaces:
SerializableMessage
- Direct Known Subclasses:
GatherProtocolMessage
public class SDPMessage extends SpinnakerRequest
Wraps up an SDP message with a header and optional data.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SDPMessage(ByteBuffer buffer, boolean isBMP)
Deserialises an SDP message from a buffer.SDPMessage(SDPHeader header)
Create an SDP message with no payload.SDPMessage(SDPHeader header, byte[] data)
Create an SDP message with a payload.SDPMessage(SDPHeader header, byte[] data, int offset)
Create an SDP message with a payload.SDPMessage(SDPHeader header, byte[] data, int offset, int length)
Create an SDP message with a payload.SDPMessage(SDPHeader header, ByteBuffer data)
Create an SDP message with a payload. -
Method Summary
Modifier and Type Method Description void
addToBuffer(ByteBuffer buffer)
Writes this message into the given buffer as a contiguous range of bytes.ByteBuffer
getData()
Methods inherited from class uk.ac.manchester.spinnaker.messages.sdp.SpinnakerRequest
getMessageData
-
Constructor Details
-
SDPMessage
Create an SDP message with no payload.- Parameters:
header
- the message header.
-
SDPMessage
Create an SDP message with a payload.- Parameters:
header
- the message header.data
- the message payload.
-
SDPMessage
Create an SDP message with a payload.- Parameters:
header
- the message header.data
- the message payload.offset
- where in the array the payload starts.
-
SDPMessage
Create an SDP message with a payload.- Parameters:
header
- the message header.data
- the message payload.offset
- where in the array the payload starts.length
- the length of the payload in the array.
-
SDPMessage
Create an SDP message with a payload.- Parameters:
header
- the message header.data
- the message payload, in the region from the position to the limit.
-
SDPMessage
Deserialises an SDP message from a buffer.- Parameters:
buffer
- The buffer holding the message.isBMP
- Whether we're really talking to a BMP
-
-
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.
- Parameters:
buffer
- The buffer to write into.
-
getData
- Returns:
- The payload of the message, as a read-only little-endian buffer.
-