Line data Source code
1 : /*
2 : * Package : mqtt_client
3 : * Author : S. Hamblett <steve.hamblett@linux.com>
4 : * Date : 31/05/2017
5 : * Copyright : S.Hamblett
6 : */
7 :
8 : part of mqtt_client;
9 :
10 : /// Represents the payload (Body) of an MQTT Message.
11 : abstract class MqttPayload {
12 : /// Initializes a new instance of the MqttPayload class.
13 6 : MqttPayload();
14 :
15 : /// Initializes a new instance of the MqttPayload class.
16 0 : MqttPayload.fromMqttByteBuffer(MqttByteBuffer payloadStream) {
17 0 : readFrom(payloadStream);
18 : }
19 :
20 : /// Writes the payload to the supplied stream.
21 : /// A basic message has no Variable Header.
22 : void writeTo(MqttByteBuffer payloadStream);
23 :
24 : /// Creates a payload from the specified header stream.
25 : void readFrom(MqttByteBuffer payloadStream);
26 :
27 : /// Gets the length of the payload in bytes when written to a stream.
28 : int getWriteLength();
29 : }
|