Class HexFormat

java.lang.Object
org.apache.sis.internal.jdk9.HexFormat

public final class HexFormat extends Object
Place holder for a functionality defined only in JDK17.
Since:
1.2
Version:
1.2
  • Field Details

    • INSTANCE

      private static final HexFormat INSTANCE
  • Constructor Details

    • HexFormat

      private HexFormat()
  • Method Details

    • of

      public static HexFormat of()
    • parseHex

      public byte[] parseHex(CharSequence string)
      Returns the byte array parsed from the given hexadecimal string.
      Parameters:
      string - the hexadecimal string.
      Returns:
      the parsed bytes.
      Throws:
      NumberFormatException - if a character is not a hexadecimal digit.
    • fromHexDigit

      public static int fromHexDigit(int c)
      Returns the numerical value of the given hexadecimal digit. The hexadecimal digit can be the decimal digits 0 to 9, or the letters A to F ignoring case.
      Implementation note: we do not use Character.digit(char, int) because that method handled a large range of Unicode characters, which is a wider scope than what is intended here.
      Parameters:
      c - the hexadecimal digit.
      Throws:
      NumberFormatException - if the given character is not a hexadecimal digit.