public final class GSM7PACKEDStringCodec<T> extends Object implements StringCodec<T>
Modifier and Type | Method and Description |
---|---|
String |
decodeString(byte[] encoded)
Decodes a String of characters from a byte array,
expecting 7-bit packed format of GSM7 characters,
deciding whether there are 1 or 8 bits used in the last octet
based on whether its index is a multiple of 7 and the 7 bits are all 0.
|
String |
decodeString(byte[] encoded,
StringIndicators indicators)
Decodes a String of characters from a byte array,
expecting 7-bit packed format of GSM7 characters,
using the given indicators to distinguish
whether 1 or 8 bits are used in the last octet.
|
byte[] |
encodeString(String string)
Encodes a String of characters to a byte array,
accepting only GSM7 characters
and encoding them in 7-bit packed format.
|
byte[] |
encodeString(String string,
StringIndicators indicators)
Encodes a String of characters to a byte array,
accepting only GSM7 characters
and encoding them in 7-bit packed format.
|
GSM7PACKEDStringCodec<T> |
getLaxDecoder()
Gets the standard GSM7PACKEDStringCodec.
|
static <T> GSM7PACKEDStringCodec<T> |
getStandardCodec()
Gets the standard GSM7PACKEDStringCodec.
|
public static <T> GSM7PACKEDStringCodec<T> getStandardCodec()
public GSM7PACKEDStringCodec<T> getLaxDecoder()
getLaxDecoder
in interface StringCodec<T>
public byte[] encodeString(String string, StringIndicators indicators)
encodeString
in interface StringCodec<T>
string
- the String to be encoded to a byte arrayindicators
- the StringIndicators object in which to set the indicatorsUnsupportedDigitException
- if any character of the given String is not a GSM7 characterpublic byte[] encodeString(String string)
encodeString
in interface StringCodec<T>
string
- the String to be encoded to a byte arrayUnsupportedDigitException
- if any character of the given String is not a GSM7 characterpublic String decodeString(byte[] encoded, StringIndicators indicators)
decodeString
in interface StringCodec<T>
encoded
- the byte array to be decoded to a Stringindicators
- indicator values needed for decodingpublic String decodeString(byte[] encoded)
decodeString
in interface StringCodec<T>
encoded
- the byte array to be decoded to a String