|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.objectxp.msg.util.SmsHeader
public class SmsHeader
This class represents a GSM User Data Header (UDH). It can be used to construct custom UDH elements.
The example below demonstrates how to add a "Application Port Addressing" header to a SMS.
import com.objectxp.msg.SmsMessage;
import com.objectxp.msg.util.*;
SmsMessage msg = new SmsMessage();
SmsHeader hdr = new SmsHeader();
hdr.add(new PortAddressingHeaderElement(true, 5512, 4711));
msg.setUserDataHeader(hdr.getBytes());
msg.setMessage("Hello World");
See the GSM 03.40 specification for more information about the User Data Header.
SmsHeaderElement| Constructor Summary | |
|---|---|
SmsHeader()
Construct a new, empty SmsHeader. |
|
| Method Summary | |
|---|---|
void |
add(SmsHeaderElement e)
Add a SMS Header Element. |
java.util.Enumeration |
elements()
Get all Header elements belonging to this SMS Header. |
byte[] |
getBytes()
Get the binary representation of the SMS Header. |
int |
getLength()
Returns the number of elements contained within the SMS Header. |
static SmsHeader |
parseHeader(byte[] data)
Construct a SmsHeader object by parsing UDH data. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SmsHeader()
| Method Detail |
|---|
public static SmsHeader parseHeader(byte[] data)
throws HeaderParseException
data - the user data header
HeaderParseException - if parsing the data failspublic void add(SmsHeaderElement e)
e - a SMS Header elementpublic java.util.Enumeration elements()
SmsHeaderElements.public int getLength()
public java.lang.String toString()
toString in class java.lang.Objectpublic byte[] getBytes()
SmsMessage.setUserDataHeader(byte[]).
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||