|
||||||||||
| 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
public class AlphabetEncoding
SMS Alphabet to Java String mapping interface. Implementations of this interface convert Java Unicode strings into a series of bytes representing the String in a particular SMS alphabet.
| Constructor Summary | |
|---|---|
protected |
AlphabetEncoding(int dcs)
Create a new alphabet encoding. |
| Method Summary | |
|---|---|
String |
decode(byte[] data)
Convert SMS message text into a Java String. |
String |
decode(byte[] data,
int offset,
int length)
Convert SMS message text into a Java String. |
byte[] |
encode(String string)
Convert a Java String into SMS message text. |
String |
getCharset()
Get the character set in use by this alpabet encoding (if any). |
int |
getEncodedSize(String string)
Get the number of bytes a particular string would encode as on the wire. |
protected void |
setCharset(String charset)
Set the charset of this alphabet encoding. |
| 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 |
| Constructor Detail |
|---|
protected AlphabetEncoding(int dcs)
dcs - The data coding value to be used for this encoding.| Method Detail |
|---|
public String getCharset()
null if the implementation is not using a JVM-
supported character set.public String decode(byte[] data)
null. In such cases,
the String "" will be returned.
public String decode(byte[] data,
int offset,
int length)
data - The bytes to decode.offset - The offset within the data to begin decoding characters.length - The number of bytes to decode to characters.
NullPointerException - If data is null.public byte[] encode(String string)
null string. In
such cases, a byte array of length 0 will be returned.
public int getEncodedSize(String string)
string would encode to.
protected void setCharset(String charset)
throws UnsupportedEncodingException
charset - The character set to use for encoding and decoding.
UnsupportedEncodingException - If the JVM does not support the
specified character set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||