public class MqttPersistentData extends Object implements MqttPersistable
| Constructor and Description |
|---|
MqttPersistentData(String key,
byte[] header,
int hOffset,
int hLength,
byte[] payload,
int pOffset,
int pLength)
Construct a data object to pass across the MQTT client persistence interface.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getHeaderBytes()
Returns the header bytes in an array.
|
int |
getHeaderLength()
Returns the length of the header.
|
int |
getHeaderOffset()
Returns the offset of the header within the byte array returned by
MqttPersistable.getHeaderBytes(). |
String |
getKey() |
byte[] |
getPayloadBytes()
Returns the payload bytes in an array.
|
int |
getPayloadLength()
Returns the length of the payload.
|
int |
getPayloadOffset()
Returns the offset of the payload within the byte array returned by
MqttPersistable.getPayloadBytes(). |
public MqttPersistentData(String key, byte[] header, int hOffset, int hLength, byte[] payload, int pOffset, int pLength)
key - The key which identifies this dataheader - The message headerhOffset - The start offset of the header bytes in header.hLength - The length of the header in the header bytes array.payload - The message payloadpOffset - The start offset of the payload bytes in payload.pLength - The length of the payload in the payload bytes array
when persisting the message.public String getKey()
public byte[] getHeaderBytes()
MqttPersistableMqttPersistable.getHeaderOffset()
and continue for MqttPersistable.getHeaderLength().getHeaderBytes in interface MqttPersistablepublic int getHeaderLength()
MqttPersistablegetHeaderLength in interface MqttPersistablepublic int getHeaderOffset()
MqttPersistableMqttPersistable.getHeaderBytes().getHeaderOffset in interface MqttPersistablepublic byte[] getPayloadBytes()
MqttPersistableMqttPersistable.getPayloadOffset()
and continue for MqttPersistable.getPayloadLength().getPayloadBytes in interface MqttPersistablepublic int getPayloadLength()
MqttPersistablegetPayloadLength in interface MqttPersistablepublic int getPayloadOffset()
MqttPersistableMqttPersistable.getPayloadBytes().getPayloadOffset in interface MqttPersistableCopyright © 2017 Eclipse Paho. All Rights Reserved.