Class HexTool

java.lang.Object
tools.HexTool

public class HexTool extends Object
Provides a class for manipulating hexadecimal numbers.
Since:
Revision 206
  • Constructor Details

    • HexTool

      public HexTool()
  • Method Details

    • toString

      public static final String toString(byte byteValue)
      Turns a byte into a hexadecimal string.
      Parameters:
      byteValue - The byte to convert.
      Returns:
      The hexadecimal representation of byteValue
    • toString

      public static final String toString(ByteBuffer buf)
      Turns a org.apache.mina.common.ByteBuffer into a hexadecimal string.
      Parameters:
      buf - The org.apache.mina.common.ByteBuffer to convert.
      Returns:
      The hexadecimal representation of buf
    • toString

      public static final String toString(int intValue)
      Turns an integer into a hexadecimal string.
      Parameters:
      intValue - The integer to transform.
      Returns:
      The hexadecimal representation of intValue.
    • toString

      public static final String toString(byte[] bytes)
      Turns an array of bytes into a hexadecimal string.
      Parameters:
      bytes - The bytes to convert.
      Returns:
      The hexadecimal representation of bytes
    • toStringFromAscii

      public static final String toStringFromAscii(byte[] bytes)
      Turns an array of bytes into a ASCII string. Any non-printable characters are replaced by a period (.)
      Parameters:
      bytes - The bytes to convert.
      Returns:
      The ASCII hexadecimal representation of bytes
    • toPaddedStringFromAscii

      public static final String toPaddedStringFromAscii(byte[] bytes)
    • getByteArrayFromHexString

      public static byte[] getByteArrayFromHexString(String hex)
      Turns an hexadecimal string into a byte array.
      Parameters:
      hex - The string to convert.
      Returns:
      The byte array representation of hex
    • getOpcodeToString

      public static final String getOpcodeToString(int op)