Class HexTool
java.lang.Object
tools.HexTool
Provides a class for manipulating hexadecimal numbers.
- Since:
- Revision 206
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Turns an hexadecimal string into a byte array.static final StringgetOpcodeToString(int op) static final StringtoPaddedStringFromAscii(byte[] bytes) static final StringtoString(byte byteValue) Turns a byte into a hexadecimal string.static final StringtoString(byte[] bytes) Turns an array of bytes into a hexadecimal string.static final StringtoString(int intValue) Turns an integer into a hexadecimal string.static final StringtoString(ByteBuffer buf) Turns aorg.apache.mina.common.ByteBufferinto a hexadecimal string.static final StringtoStringFromAscii(byte[] bytes) Turns an array of bytes into a ASCII string.
-
Constructor Details
-
HexTool
public HexTool()
-
-
Method Details
-
toString
Turns a byte into a hexadecimal string.- Parameters:
byteValue- The byte to convert.- Returns:
- The hexadecimal representation of
byteValue
-
toString
Turns aorg.apache.mina.common.ByteBufferinto a hexadecimal string.- Parameters:
buf- Theorg.apache.mina.common.ByteBufferto convert.- Returns:
- The hexadecimal representation of
buf
-
toString
Turns an integer into a hexadecimal string.- Parameters:
intValue- The integer to transform.- Returns:
- The hexadecimal representation of
intValue.
-
toString
Turns an array of bytes into a hexadecimal string.- Parameters:
bytes- The bytes to convert.- Returns:
- The hexadecimal representation of
bytes
-
toStringFromAscii
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
-
getByteArrayFromHexString
Turns an hexadecimal string into a byte array.- Parameters:
hex- The string to convert.- Returns:
- The byte array representation of
hex
-
getOpcodeToString
-