de.enough.polish.android.messaging
Class BinaryMessageImpl
java.lang.Object
de.enough.polish.android.messaging.MessageImpl
de.enough.polish.android.messaging.BinaryMessageImpl
- All Implemented Interfaces:
- BinaryMessage, Message
public class BinaryMessageImpl
- extends MessageImpl
- implements BinaryMessage
Provides BinaryMessage functionalities.
|
Method Summary |
byte[] |
getPayloadData()
Returns the message payload data as an array
of bytes. |
void |
setPayloadData(byte[] data)
Sets the payload data of this message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BinaryMessageImpl
public BinaryMessageImpl(String address)
BinaryMessageImpl
public BinaryMessageImpl(String address,
Date timestamp)
getPayloadData
public byte[] getPayloadData()
- Description copied from interface:
BinaryMessage
- Returns the message payload data as an array
of bytes.
Returns null, if the payload for the message
is not set.
The returned byte array is a reference to the
byte array of this message and the same reference
is returned for all calls to this method made before the
next call to setPayloadData.
- Specified by:
getPayloadData in interface BinaryMessage
- Returns:
- the payload data of this message or null if the data has not been set
- See Also:
BinaryMessage.setPayloadData(byte[])
setPayloadData
public void setPayloadData(byte[] data)
- Description copied from interface:
BinaryMessage
- Sets the payload data of this message. The payload may
be set to
null.
Setting the payload using this method only sets the
reference to the byte array. Changes made to the contents
of the byte array subsequently affect the contents of this
BinaryMessage object. Therefore, applications
should not reuse this byte array before the message is sent and the
MessageConnection.send method returns.
- Specified by:
setPayloadData in interface BinaryMessage
- Parameters:
data - - payload data as a byte array- See Also:
BinaryMessage.getPayloadData()