Package de.intarsys.tools.hex
Class HexTools
- java.lang.Object
-
- de.intarsys.tools.hex.HexTools
-
public class HexTools extends java.lang.Object
Helper class for faster mapping of bytes to their hex equivalent
-
-
Field Summary
Fields Modifier and Type Field Description static byte[][]
ByteToHex
ASCII byte values for the hex strings.static byte[][]
byteToHexLower
ASCII byte values for the hex strings.
-
Constructor Summary
Constructors Constructor Description HexTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
bytesToHexString(byte[] data)
static java.lang.String
bytesToHexString(byte[] data, int offset, int length)
static java.lang.String
bytesToHexString(byte[] data, int offset, int length, boolean space)
static int
hexDigitToInt(char c)
The numeric value for the hex digit, return -1 if not valid digitstatic byte[]
hexStringToBytes(java.lang.String hexString)
static int
hexStringToInt(java.lang.String hexString)
static boolean
isHexDigit(char i)
Evaluate totrue
ifi
is a valid hex digit
-
-
-
Method Detail
-
bytesToHexString
public static java.lang.String bytesToHexString(byte[] data)
-
bytesToHexString
public static java.lang.String bytesToHexString(byte[] data, int offset, int length)
-
bytesToHexString
public static java.lang.String bytesToHexString(byte[] data, int offset, int length, boolean space)
-
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
public static byte[] hexStringToBytes(java.lang.String hexString)
-
hexStringToInt
public static int hexStringToInt(java.lang.String hexString)
-
isHexDigit
public static boolean isHexDigit(char i)
Evaluate totrue
ifi
is a valid hex digit- Parameters:
i
- A char representing a hex digit.- Returns:
true
ifi
is a valid hex digit.
-
-