Package org.apache.sis.internal.jdk9
Class HexFormat
java.lang.Object
org.apache.sis.internal.jdk9.HexFormat
Place holder for a functionality defined only in JDK17.
- Since:
- 1.2
- Version:
- 1.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
fromHexDigit
(int c) Returns the numerical value of the given hexadecimal digit.static HexFormat
of()
byte[]
parseHex
(CharSequence string) Returns the byte array parsed from the given hexadecimal string.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
HexFormat
private HexFormat()
-
-
Method Details
-
of
-
parseHex
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 useCharacter.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.
-