public class Message extends Object
| Constructor and Description |
|---|
Message()
Basic constructor
|
Message(byte[] byteArray)
byteArray: a byte array containing the body of the message
|
Message(ByteArrayInputStream stream)
stream: a stream containing the body of the message
|
Message(String string) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCustomProperties() |
ByteArrayOutputStream |
getBodyStream()
The stream content of the body.
|
byte[] |
getBytes()
The byte content of the body.
|
Map<String,String> |
getProperties() |
void |
setDeliveryAcknowledgement(DeliveryAcknowledgement deliveryAcknowledgement) |
void |
setProperties(Map<String,String> properties) |
void |
setTo(String deviceId) |
public Message()
public Message(ByteArrayInputStream stream)
stream - The stream containing the message bodypublic Message(byte[] byteArray)
byteArray - The byte array containing the message bodypublic Message(String string)
string - - a string containing the body of the message.
Important: If a string is passed, the HttpBatch.SerializeAsString is set to true,
and the internal byte representation is serialized as UTF-8,
with HttpBatch.Encoding set to UTF-8.public void setTo(String deviceId)
public ByteArrayOutputStream getBodyStream()
public byte[] getBytes()
public final void setDeliveryAcknowledgement(DeliveryAcknowledgement deliveryAcknowledgement)
deliveryAcknowledgement - the delivery acknowledgement to setpublic void clearCustomProperties()
Copyright © 2023. All rights reserved.