Package org.wildfly.common.codec
Class Alphabet
java.lang.Object
org.wildfly.common.codec.Alphabet
- Direct Known Subclasses:
Base32Alphabet,Base64Alphabet
A base-n encoder/decoder alphabet. Alphabets may be little-endian or big-endian. Each base has its own subclass.
-
Method Details
-
isLittleEndian
public boolean isLittleEndian()Determine whether this is a little-endian or big-endian alphabet.- Returns:
trueif the alphabet is little-endian,falseif it is big-endian
-
encode
public abstract int encode(int val) Encode the given byte value to a code point.- Parameters:
val- the value- Returns:
- the Unicode code point
-
decode
public abstract int decode(int codePoint) Decode the given code point (character). If the code point is not valid, -1 is returned.- Parameters:
codePoint- the Unicode code point- Returns:
- the decoded value or -1 if the code point is not valid
-