|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.encoding.AbstractMessageEncoding<String>
org.mobicents.protocols.smpp.encoding.AlphabetEncoding
org.mobicents.protocols.smpp.encoding.DefaultAlphabetEncoding
public class DefaultAlphabetEncoding
This class encodes and decodes Java Strings to and from the SMS default alphabet. It also supports the default extension table. The default alphabet and it's extension table is defined in GSM 03.38.
| Field Summary | |
|---|---|
protected char[] |
CHAR_TABLE
|
protected char[] |
EXT_CHAR_TABLE
Extended character table. |
static int |
EXTENDED_ESCAPE
|
static int |
PAGE_BREAK
Page break (extended table). |
| Constructor Summary | |
|---|---|
DefaultAlphabetEncoding()
|
|
| Method Summary | |
|---|---|
String |
decode(byte[] data,
int offset,
int length)
Decode an SMS default alphabet-encoded octet string into a Java String. |
byte[] |
encode(String s)
Encode a Java String into a byte array using the SMS Default alphabet. |
int |
getCharSize()
|
int |
getUnknownCharReplacement()
Get the current code point in use for unknown characters. |
byte[] |
pack(byte[] unpacked)
Pack a byte array according to the GSM bit-packing algorithm. |
void |
setUnknownCharReplacement(int unknownCharReplacement)
Set the byte to use when there is no code point for a Unicode character. |
byte[] |
unpack(byte[] packed)
Unpack a byte array according to the GSM bit-packing algorithm. |
| Methods inherited from class org.mobicents.protocols.smpp.encoding.AlphabetEncoding |
|---|
decode, getCharset, getEncodedSize, setCharset |
| Methods inherited from class org.mobicents.protocols.smpp.encoding.AbstractMessageEncoding |
|---|
getDataCoding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int EXTENDED_ESCAPE
public static final int PAGE_BREAK
protected final char[] CHAR_TABLE
protected final char[] EXT_CHAR_TABLE
EXTENDED_ESCAPE| Constructor Detail |
|---|
public DefaultAlphabetEncoding()
| Method Detail |
|---|
public void setUnknownCharReplacement(int unknownCharReplacement)
unknownCharReplacement - A code point for one of the characters
in the basic character table.
IllegalArgumentException - If 0 < unknownCharReplacement
< 127 or unknownCharReplacement is 0x1b
(the extended escape character).public int getUnknownCharReplacement()
setUnknownCharReplacement(int)
public String decode(byte[] data,
int offset,
int length)
decode in class AlphabetEncodingdata - The bytes to decode.offset - The offset within the data to begin decoding characters.length - The number of bytes to decode to characters.public byte[] encode(String s)
encode in interface MessageEncoding<String>encode in class AlphabetEncodingpublic int getCharSize()
public byte[] pack(byte[] unpacked)
Having said all that, most SMSCs do NOT use the packing algorithm when communicating over TCP/IP. They either use a full 8-bit alphabet such as ASCII or Latin-1, or they accept the default alphabet in its unpacked form. As such, you will be unlikely to need this method.
unpacked - The unpacked byte array.
public byte[] unpack(byte[] packed)
pack method.
packed - The packed byte array.
pack(byte[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||