FileDocCategorySizeDatePackage
TextObject.javaAPI DocphoneME MR2 API (J2ME)2684Wed May 02 18:00:32 BST 2007com.sun.midp.io.j2me.sms

TextObject

public class TextObject extends MessageObject implements TextMessage
Implements an instance of a text message.

Fields Summary
byte[]
buffer
Buffer to be used.
Constructors Summary
public TextObject(String addr)
Constructs a text-specific message.

param
addr the destination address of the message

	super(MessageConnection.TEXT_MESSAGE, addr);
    
Methods Summary
byte[]getBytes()
Gets the raw byte array.

return
an array of raw UCS-2 payload data
see
#getPayloadText
see
#setBytes

	return buffer;
    
public java.lang.StringgetPayloadText()
Returns the message payload data as a String.

return
the payload of this message, or null if the payload for the message is not set
see
#setPayloadText

	if (buffer == null) {
	    return null;
	}
	return TextEncoder.toString(buffer);
    
voidsetBytes(byte[] data)
Sets the raw byte array.

param
data an array of raw UCS-2 payload data.
see
#getBytes

	buffer = data;
    
public voidsetPayloadText(java.lang.String data)
Sets the payload data of this message. The payload data may be null.

param
data payload data as a String
see
#getPayloadText

	if (data != null) {
	    buffer = TextEncoder.toByteArray(data);
	} else {
	    buffer = null;
	}
	return;