public class MessageTopicData extends Message
The message contents the TimeStamp, the Topic name and the "pay load".
Header:
[TimeStamp (8 bytes)] + [TopicNameSize (2 byte)] + [TopicName (TopicNameSize bytes)]
Payload:
plan buffer containing the data assigned to the topic.
Message.MessageType
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
topicName |
bufferHeader, bufferPayload, bufferPrologue, msgFlag, sourceIPPort, timeStamp, type
Constructor and Description |
---|
MessageTopicData()
Creates an empty message to be populated using the
"fromInputStream" method.
|
MessageTopicData(IPPort srcIPP,
java.lang.String nam,
byte[] bufPay)
Create a topic message based on the passed buffer.
|
Modifier and Type | Method and Description |
---|---|
private byte[] |
computeHeader()
Compute the header of a brand new message.
|
protected boolean |
fromInputStream(java.io.InputStream is,
int size)
Populates a topic data message reading data from an input stream.
|
java.lang.String |
getTopicName() |
protected void |
toOutputStream(java.io.OutputStream os)
It writes the "MessageXXX" instance to the specified stream.
|
computePrologue, fromInputStream, getBufferHeader, getBufferPayload, getBufferPrologue, getSourceIPPort, getTimeStamp, getType
public MessageTopicData()
public MessageTopicData(IPPort srcIPP, java.lang.String nam, byte[] bufPay)
nam
- topic namebufPay
- topic payloadprivate byte[] computeHeader()
protected boolean fromInputStream(java.io.InputStream is, int size) throws java.io.IOException
fromInputStream
in class Message
java.io.IOException
public java.lang.String getTopicName()
protected void toOutputStream(java.io.OutputStream os) throws java.io.IOException
Message
toOutputStream
in class Message
java.io.IOException