Class HexTools

java.lang.Object
de.intarsys.tools.hex.HexTools

public class HexTools extends Object
Helper class for faster mapping of bytes to their hex equivalent
  • Field Details

    • ByteToHex

      public static final byte[][] ByteToHex
      ASCII byte values for the hex strings.
    • byteToHexLower

      public static final byte[][] byteToHexLower
      ASCII byte values for the hex strings.
  • Constructor Details

    • HexTools

      public HexTools()
  • Method Details

    • bytesToHexString

      public static String bytesToHexString(byte[] data)
    • bytesToHexString

      public static String bytesToHexString(byte[] data, int offset, int length)
    • bytesToHexString

      public static 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(String hexString)
    • hexStringToInt

      public static int hexStringToInt(String hexString)
    • isHexDigit

      public static boolean isHexDigit(char i)
      Evaluate to true if i is a valid hex digit
      Parameters:
      i - A char representing a hex digit.
      Returns:
      true if i is a valid hex digit.