javax.wireless.messaging
Interface BinaryMessage

All Superinterfaces:
Message

public interface BinaryMessage
extends Message

An interface representing a binary message.

This is a subinterface of Message, which contains methods to get and set the binary data payload. The setPayloadData(byte[]) method sets the value of the payload in the data container without any checking whether the value is valid in any way. Methods for manipulating the address portion of the message are inherited from Message.

Object instances implementing this interface are just containers for the data that is passed in.

This interface is defined in JSR 205: Wireless Messaging API 2.0, which extends and enhances JSR 120: Wireless Messaging API

Since:
JDE 4.0.0

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 interface javax.wireless.messaging.Message
getAddress, getTimestamp, setAddress
 

Method Detail

getPayloadData

public byte[] getPayloadData()
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(byte[]).
Returns:
the payload data of this message or null if the data has not been set.
Since:
JDE 4.0.0
See Also:
setPayloadData(byte[])

setPayloadData

public void setPayloadData(byte[] data)
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(Message) method returns.

Parameters:
data - payload data as a byte array.
Since:
JDE 4.0.0
See Also:
getPayloadData()



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.