Package de.intarsys.tools.hex
Class HexTools
java.lang.Object
de.intarsys.tools.hex.HexTools
Helper class for faster mapping of bytes to their hex equivalent
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte[][]ASCII byte values for the hex strings.static final byte[][]ASCII byte values for the hex strings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbytesToHexString(byte[] data) static StringbytesToHexString(byte[] data, int offset, int length) static StringbytesToHexString(byte[] data, int offset, int length, boolean space) static inthexDigitToInt(char c) The numeric value for the hex digit, return -1 if not valid digitstatic byte[]hexStringToBytes(String hexString) static inthexStringToInt(String hexString) static booleanisHexDigit(char i) Evaluate totrueifiis a valid hex digit
-
Field Details
-
ByteToHex
public static final byte[][] ByteToHexASCII byte values for the hex strings. -
byteToHexLower
public static final byte[][] byteToHexLowerASCII byte values for the hex strings.
-
-
Constructor Details
-
HexTools
public HexTools()
-
-
Method Details
-
bytesToHexString
-
bytesToHexString
-
bytesToHexString
-
hexDigitToInt
public static int hexDigitToInt(char c) The numeric value for the hex digit, return -1 if not valid digit- Parameters:
c- A char representing a hex digit.- Returns:
- The numeric value of the hex digit
-
hexStringToBytes
-
hexStringToInt
-
isHexDigit
public static boolean isHexDigit(char i) Evaluate totrueifiis a valid hex digit- Parameters:
i- A char representing a hex digit.- Returns:
trueifiis a valid hex digit.
-