Class Base32Alphabet

java.lang.Object
org.wildfly.common.codec.Alphabet
org.wildfly.common.codec.Base32Alphabet

public abstract class Base32Alphabet extends Alphabet
A base-32 alphabet.
See Also:
  • Field Details

  • Constructor Details

    • Base32Alphabet

      protected Base32Alphabet(boolean littleEndian)
      Construct a new instance.
      Parameters:
      littleEndian - true if the alphabet is little-endian (LSB first), false otherwise
  • Method Details

    • encode

      public abstract int encode(int val)
      Encode the given 5-bit value to a code point.
      Specified by:
      encode in class Alphabet
      Parameters:
      val - the 5-bit value
      Returns:
      the Unicode code point
    • decode

      public abstract int decode(int codePoint)
      Decode the given code point. If the code point is not valid, -1 is returned.
      Specified by:
      decode in class Alphabet
      Parameters:
      codePoint - the code point
      Returns:
      the decoded 5-bit value or -1 if the code point is not valid