public final class IA5StringCodec<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,
taking all values (regardless of given odd),
expecting only values [0,127],
and decoding them to ASCII/ISO646-US characters.
|
String |
decodeString(byte[] encoded,
StringIndicators indicators)
Decodes a String of characters from a byte array,
taking all values (regardless of given odd),
expecting only values [0,127],
and decoding them to ASCII/ISO646-US characters.
|
byte[] |
encodeString(String string)
Encodes a String of characters to a byte array,
accepting only ASCII/ISO646-US characters,
and encoding each character according to that character set.
|
byte[] |
encodeString(String string,
StringIndicators indicators)
Encodes a String of characters to a byte array,
accepting only ASCII/ISO646-US characters,
and encoding each character according to that character set.
|
IA5StringCodec<T> |
getLaxDecoder()
Gets an IA5StringCodec like the standard one except that decoding invalid characters
produces ? characters instead of throwing an exception.
|
static <T> IA5StringCodec<T> |
getStandardCodec()
Gets the standard IA5StringCodec.
|
public static <T> IA5StringCodec<T> getStandardCodec()
public IA5StringCodec<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 a non-ASCII character is foundpublic byte[] encodeString(String string)
encodeString
in interface StringCodec<T>
string
- the String to be encoded to a byte arrayUnsupportedDigitException
- if a non-ASCII character is foundpublic 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 decoding (ignored)UnsupportedDigitException
- if any encoded content is not in range [0,127]public String decodeString(byte[] encoded)
decodeString
in interface StringCodec<T>
encoded
- the byte array to be decoded to a StringUnsupportedDigitException
- if any encoded content is not in range [0,127]