public class GSM7BitAlphabet extends Object
This class deals in terms of "unpacked" values, stored as one 7-bit value per byte. To transform this to the packed representations needed by SMS/CBS/USSD, use the methods in GSM7BitPacking.
Modifier and Type | Method and Description |
---|---|
static int |
countCharacters(String src)
Count the number of 7-bit characters needed to represent a given String (including escapes)
|
static String |
decode(byte[] src,
int srcpos,
int count)
Decode an unpacked representation in the 7-bit alphabet to a String
|
static void |
encode(String src,
byte[] dst,
int dstpos)
Encode a String to an unpacked 7-bit representation
|
public static String decode(byte[] src, int srcpos, int count)
src
- the array to read fromsrcpos
- the offset (in bytes) in src to readcount
- the number of codes to readpublic static void encode(String src, byte[] dst, int dstpos)
src
- the string to encodedst
- the array to encode todstpos
- the offset within dst to start atpublic static int countCharacters(String src)
src
- the string to examinesrc
, or -1 if there are unsupported characters present