Class GSM7BitAlphabet
- java.lang.Object
-
- com.opencloud.slee.resources.in.datatypes.sms.GSM7BitAlphabet
-
public class GSM7BitAlphabet extends Object
Utilities for translating between Strings and values in the GSM 7-bit alphabet, as defined in 3GPP TS 23.038 section 6.2.1.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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 Stringstatic void
encode(String src, byte[] dst, int dstpos)
Encode a String to an unpacked 7-bit representation
-
-
-
Method Detail
-
decode
public static String decode(byte[] src, int srcpos, int count)
Decode an unpacked representation in the 7-bit alphabet to a String- Parameters:
src
- the array to read fromsrcpos
- the offset (in bytes) in src to readcount
- the number of codes to read- Returns:
- a decoded String
-
encode
public static void encode(String src, byte[] dst, int dstpos)
Encode a String to an unpacked 7-bit representation- Parameters:
src
- the string to encodedst
- the array to encode todstpos
- the offset within dst to start at
-
countCharacters
public static int countCharacters(String src)
Count the number of 7-bit characters needed to represent a given String (including escapes)- Parameters:
src
- the string to examine- Returns:
- number of 7-bit characters needed to represent
src
, or -1 if there are unsupported characters present
-
-